WIFI Station skyviper

Hello Guys ,

I,m making this new post since this one Sonix Board Recovery without WiFi? was not fully related to wifi station , I tried all from that post.

I also tried setting the router to 192.168.99.2 to see if that help in case DHCP was failing.

what is the favourite type of security for skyviper WEP,WPA,WPA2 … ?

really not sure what else to try , any tips welcome ;D

Did you upgrade the firmware?
It’s been a while, but I do remember that station mode did not work on mine with the stock firmware that came with the Viper, which was old (date circa August). Worked when I upgraded.

Hi OlivierB , thank you for helping.

yes i have updated firmware.

the SD card structure looks like this :

I have tested with 3 different skyviper units and different wifi stations and SD cards models. I might still be doing something wrong not sure why not working. i also tried uplaod the WIFI.txt file via de upload tool in the web config firmware tab.

if anything else i could try let me know.

The behaviour is that when SD card in with WIFI.txt no more access point from skyviper which is the normal thing as it should be connected to the station but it does not connect to station.

May be a routing/networking problem? You could try wireshark on windows or tcpdump on Linux. Try to look for packets from the viper, these would show with mac addresses including

Shenzhen_ … (ec:3d:fd …),

ec:3d:fd being the manufacturer’s part of the mac address.

and look for associated IP address.

The viper should broadcast with that ip address and you should see … User Datagram Protocol, Src Port : 14550, Dst Port: 14550 Data (17 bytes) on it’s DHCP assigned address

and ip adress would be the one running the web server.

Both mission planner and qgroundcontrol will automatically scan and find these, also, (need to select udp for mission planner) have you tried that?

Hi , i appreciate your elaborated reply.

I check for the devices connected to the network, but i dont see the skyviper or other unknown device. A fast comfortable way i check via an android app NetX , i use it normally for checking ESP devices and works well.

I have also tried to connect via MP even though the chances that this work not seeing in it the network were very little i can connect to MP if using the skyviper default access point same with my GS i can connect too if using the acces point from the device but never from another wifi.

I,m using now a dedicated ubiquiti brand new router just for this purpose. what will be the most ideal configuration for SkyViper to connect to a WIFI ? i mean wifi name lengh password capitals or not ,security , special things , IP so i configured the router exactly with those values and try.

what is the best tested SD card for it any special formatting ?

any problems when editing the txt file , it has to be on notepad , notepad ++ ?

I dont know any single detail that can help the wifi station i could try.

thanks

So in short when you don’t have WIFI.TXT on SD card it works fine and you can access web server at 192.168.99.1, and when you have WIFI.TXT with your existing wifi network and WIFI.TXT with two lines

STATION_SSID=your_ssid
STATION_PASS=your_password

it “disappears” with no packets seen from it?

Sounds like your viper is not even connecting to your network.
Only thing I can think of is an issue with the text formatting of WIFI.TXT, and/or your router somehow rejecting the connection.

One thing to try, when you edit WIFI.TXT, say notepad++, is to check end of line settings/conversion if editing on windows. Shouldn’t make a difference, but some strange settings could make the password or file invalid.

Also is your router set to accept 192.168.X.Y addresses? I think you wrote earlier that you had tried to set its address to 192.99.1.2 and it still didn’t work so this should be the case.

Can you see if you can set your router to see what it rejects and see that it at least sees the MAC address of the viper? Maybe one thing to try, sort of desperate:
Grab the MAC address of the viper when in client mode and write it down, and set the router DHCP to assign a “known to work IP address” to that MAC address and try accessing with browser.

It is interesting that the WIFI.txt file doesn’t have you specify the security mode of the network. (WEP,WPA,WPA2, etc) What modes does it work with? Also, how does it know which mode to connect with?

EDIT: Deleted everything I said. That code was for the regular WIFI mode, Line number 988 is where the WIFI_Station mode is read in.

The function that handles setting up wifi_station mode is occluded behind a library file.

static void setup_wifi_station(const char *ssid, const char *password)
{
    xWifiStackEvent_t xTestEvent;

    print_msg_queue("Setting up for WiFi station SSID='%s' PASS='%s'\n", ssid, password);
console_printf("Setting up for WiFi station SSID='%s' PASS='%s'\n", ssid, password);

WiFi_Task_UnInit();
dhcps_deinit();
vTaskDelay(2000);

WiFi_Task_Init(NULL, WIFI_RUN_MODE_DEV);
vTaskDelay(2000);

memset(&xTestEvent, 0x0, sizeof(xTestEvent));
xTestEvent.eEventType = eWifiSetAPInfo;
strcpy((char *)xTestEvent.sAPSSID, ssid);
strcpy((char *)xTestEvent.sAPPassWd, password);
prvSendEventToWiFiTask(&xTestEvent); // function declared in wifi_api.h
}

So we really don’t know what it does or what modes are available unless someone knows where the source is for this library.

Hello,

@OlivierB Exacly when i dont have WIFI.txt in the SD , i can connect to it with the skyviper access-point and use web config and MP and other GS.

I have resetted to factory defaults the dedicated router for this. i have also tried with the home wifi and other ones.

so this is the router config i only change the SSID and password. also i paste screen-shots from note++ , if you see anything not right let me know.

checking the devices connected to this network i do not see it i only see my mobile and the laptop.

Scott,

Only looked at this briefly, so Tridge could correct me. But it appears from a quick look of devconsole.c that WPA2 is default implemented with WIFI.TXT.

1 Like

hi, uhmm ok i tried WPA2 already but good to know to narrow the issue.

Coloursound,

Not familiar with your router, but it should not be configured as an access point (looks like how it is configured from your screenshot), just as a default router.
Did you try that?

Otherwise security settings appear good, WPA2-PSK AES should work.

Hi OlivierB,

those are the options that gives me in the access point tab i paste screen shot, i think that part should be ok as i can connect with mobile computer etc, also when you connect with a mobile phone wifi the mobile creates an access point if i,m not wrong. when i set station in that tab no more visible wifi from the device

in the other page there is a tab that says router which now is set as SOHO router and it can be set as router only as well .

anyway apart from my good or bad router configuration there must be something else , as otherwise it could have connected to the home wifi or phone access point etc. just my guess.

hope it is just some silly thing around and that we find it soon ;D

thanks

Hi guys. Having almost the exact same issue here. My Skyviper works perfectly in AP mode but will not grab DHCP in Station mode. I’m using a Netgear R7000 for wireless as well and I do see the Viper appear in the R7000’s devices log, but with no IP or hostname.

I am not sure how to interperet the log files on the Sky Viper but if someone can provide directions I’d love to dig deeper. Alternatively, are there any other IP settings I can manually specify to avoid DHCP?

I should add, my R7000 is not my DHCP server, just an AP. Actual DHCP server is on a seperate Linux box but that is never seeing the traffic from my Viper.

Hi guys,

Any updates on how ti fix this?

I manage to build the sonix firmware thanks to the great community.

Where in the files and code i could set fixed ip and toggle fix wifi station mode only with my wifi credentials ?

Thanks

glad to heard that, did you change firmware code?

Hello Huibean,

I have not get any progress on it, but it seems the file in the code for the wifi station mode is https://github.com/SkyRocketToys/Sonix/blob/9021233269f8a841c986f27649d4b98dd7e8a55c/app/dashcam/src/main_flow/ArduPilot/dev_console.c#L980

As commented by OlivierB above.

Do you know which is the file to change ip and port?

If any progress from your side to get the wifi station mode working, please let me know.

Thanks

I am not really good at writing cpp, but I would like to give you some good news, I have do a little trick in the code https://github.com/SkyRocketToys/Sonix/blob/969ef7ddd10e804d896e6a31eaee87483769b209/app/dashcam/src/main_flow/ArduPilot/dev_console.c#L585

I have rewrite the var with my wifi ssid and pwd like blew

then I use wireshark in my mac found ip 192.168.1.99 port 14550 has upd message, using Qgroundcontrol to make a GS connect is working


it may be some problem with the WIFI.TXT parse

if you want to change ip, modify this file may help, but that’s not a good choice

Hello, great it works, thank you.

For anyone trying this remember to put the WIFI. Txt in SD card anyhow.

Its a nice but tedious workaround while official solution comes.

I also tried to change the ip in the doc you suggested but it did not work router made an auto ip.

Any other place in code where i could change ip so to have a fixed kwoning one per device?

Hi Regarding the ip , i have changed the ip in here

https://github.com/SkyRocketToys/Sonix/blob/ca0c53a8564f75c3b37a2b82ec686cf53cd63ab5/middleware/lwip/src/include/LwIPConfig.h

and here

https://github.com/SkyRocketToys/Sonix/blob/ca0c53a8564f75c3b37a2b82ec686cf53cd63ab5/middleware/lwip/src/include/lwip/dhcps.h

I change from 192.168.99.1 to 192.168.1.101

then load the new firmware .

The router is set to 192.168.1.1 and my wifi device in the computer to 192.168.1.100 but still i can not get the fixe ip it create this one 192.168.1.241 any hint to be able to set the fixed ip ? so to recognise device per ip and therefore use the webconfig to adjust by the ip . as if you have many and all with same ip or unknow ip not a nice solution.

hope this ip could be change in the future via webconfig and WIFI.TXT procedures.