Sonix Board Recovery without WiFi?

Hello! I have somehow gotten the Sonix board on my SkyViper into a state where it doesn’t broadcast a WiFi network anymore.

After the first few flights out of the box, I decided to look around in the web interface and changed the SSID and password. I didn’t have the correct SSID format so the SkyViper app didn’t recognize the network anymore. I decided the easiest way to set it back was to hit the factory reset button in the web interface. The WiFi went down as expected, but never came back up.

SkyRocket support directed me to try placing FACRESET.TXT and WIFI.TXT files on the microSD, as well as a flight board initiated reset by holding down the PHOTO and VIDEO buttons on the controller. However, none of these methods seemed to have any effect. The card was 16GB formatted FAT32 and was completely empty besides the TXT or firmware files I was trying.

This function in the Sonix board code seems to remove the FACRESET.TXT file is if’s being read. However, my FACRESET.TXT file is never removed from the card.

This is the output from the UART (115200 baud) on TP2 of the Sonix board. The output is the same upon power-up no matter what I do and nothing else is printed after about 1 second:

bootsel...G=iI[D4B0091B][002BFE40]Srtos run in NORMAL
snx i2c:0 controller at 0x98300000 (irq = 1)
snx i2c:1 controller at 0x98400000 (irq = 2)
isp camera driver loaded   
Audio Driver: audio driver init ok.
Audio Middleware: audio middleware init ok.
serial_flash ID=c2,20,15   
### serial_flash speed = 0 
serial_flash(MXIC) , size = 2MB

Traffic on the cable from the flight board to the Sonix board consisted only of HEARTBEATs and NAMED_VALUE_INTs corresponding to the controller button presses. There was no traffic from the Sonix board to the flight board. Mission Planner connects fine via this cable, and the rest of the drone flies fine after IMU and Mag calibration.

I am not sure whether I should be seeing periodic text messages on TP2. Nor am I sure whether it’s possible for the firmware (or NVRAM?) to be corrupt. I put FIRMWARE_660R_F.bin (also renamed to FIRMWARE_660R.bin) onto the microSD, but I don’t think the board is booting from it. SkyRocket’s README says that this file is for “when the bootloader pin is used on the Sonix board”. Presumably, that means I should pull a pin to 3.3V or Gnd. However, I do not know what pin or test point is the bootloader pin since I haven’t gotten a detailed datasheet nor reference manual for the chip, bootloader, or SDK from Sonix.

My goal is to get the SkyViper to how it was when it came out of the box juuuust last week, I would greatly appreciate any help or ideas of what I should poke at.

1 Like

ahh, you’ve managed to solder on the debug console, great!
I had assumed I’d be helping you at a much higher level. I’m delighted that you’re happy to be hacking at this level.

yes, its GPIO2 on the silkscreen, and you need to pull it to GND on powerup. When you do that the sonix bootloader will look for FIRMWARE_660R_F.bin on the microSD and install that. You’ll see a huge amount of traffic on the debug console of the sonix while it does that.

and I’d love it if you could help me reproduce the steps you went through to brick the sonix. I tried factory reset a dozen times today after I saw your msg, and it worked correctly every time.
Cheers, Tridge

1 Like

ahh, darn, I just realized the production boards have a changed silkscreen, and GPIO2 isn’t as clearly marked, I’ll do a photo

frustrating, all of my production boards have hot-glue to stop the bl cable coming off. When I tried to remove the hot-glue to reveal the pin, the cable came off :slight_smile:


It’s one of the two pads I have marked in that photo. I think its the lower one, but as the lead came off, I’m not completely sure. Sorry!
I can find out for sure tomorrow and get Matt to do a nice photo

Hi tridge,

Looks like that did the trick! WiFi is working again. It was indeed the lower pad (TP4). It had a weak pull-up on it, so I pulled it down with a jumper. The upper one (TP5) was already at 0V.

I might have left the jumper on for too long though. It seemed to reboot a whole bunch of times after flashing. Unfortunately, I didn’t keep a log of those printouts and my memory is quite volatile.

The firmware upgrade web page showed that the ArduPilot version was 2017-07-29 (3.6.0-dev 6fc59437) and the transmitter at 2017-07-24. I didn’t record the version of the Sonix board firmware before I bricked it, but presumably it had a similar version as well? Is this an expected firmware version?

I updated to the current latest (and also stable?) of 2017-10-14 dfd2d838 on the Sonix, 2017-10-14 (3.6.0-dev d84c8a4f of ArduPilot, and 2017-10-14 of transmitter.

I’ll see if I can reliably break it again in the next few days with the latest firmware and maybe with the other version. Thanks for the very prompt response.

These are the pins that I’ve poked so far:

I was planning on taking pictures of all the boards (with better lighting than my one above) and eventually annotating all the pins and submitting a PR to put them on the SkyViper doc page or similar.

thanks! glad its working.

that is quite old, the app was supposed to have guided you towards putting on a newer version of the firmware. Did it do that? Or did you not use the app?

thanks. The only thing I can think of now is if the string for SSID or password managed to break the parser in the sonix wifi lib, and that causes it to crash when starting wifi.
Do you know what wifi SSID and password you set?

that would be very welcome!

btw, if you want to poke around at the software level on the sonix, try telnet to tcp port 2017. Lots of stuff there.
Source code here:


the ArduPilot related stuff for that board is here:

I added a few additional pics here: Viper Boards Pictures

From looking at the source e.g. here and here and the wiki, adding the file WIFI.TXT with ssid and password of an existing wifi network (each on separate line, no space) on the sd card can put the viper in wifi station mode (or as a wifi client, changing from default access point mode):

STATION_SSID=yourSSID
STATION_PASS=yourpassword

I’ve tried this but for some reason nothing seems to change. I would have thought that with a wifi router with an ip address of say 192.168.99.10, I should be able to ping the viper (and access web server) if it is configured in station mode with ip address of 192.168.99.1. Yet I still see its SSID advertised and can’t ping it unless I join its network.

Anyone know what I might be missing?

Hi OlivierB,

Try checking that the filesystem and your WIFI.TXT on the microSD is readable though the web interface. If not, try formatting the microSD through the web interface.

In my case, the microSD worked for bootloading, but not for anything else until the format. It showed up as 0 GB though the web interface. All the while, it was broadcasting it’s own SSID.

A good indicator of the filesystem being good seems to be that a SKYVIPER folder is created and the photo and video recording works (recording did not work for me before).

So far, I’ve had station mode connect successfully to my Android phone as a hotspot. When I try with two different 2.4 GHz access points, a Netgear Nighthawk R7000 and a Tenda AC15, association is successful, but DHCP hangs, so I’m looking into that.

Example serial console output:

…snip…
[fwupgr]sd_fwupgrade_task: sd_firmware_upgrade check…
sd hotplug chages [0, 1]
Checking for FC fw in flight_fw.abin
invalid FC FW size -1
Checking WIFI.TXT
Setting up for WiFi station SSID=‘MySSIDwasHere’ PASS=‘MyPasswordWasHere’
[rec] - chk_cardsize(108): SD (sz:14803 /free:14798 MB)
[rec] - chk_cardsize(110): Sched (used: 3 /available: 11100 MB)
[rec] - chk_cardsize(112): Picture (used: 0 /available: 1480 MB)
[rec] - rec_import_files(638): (Record) with num (1) res (2)
[rec] - rec_import_files(638): (Snapshot) with num (10) res (2)
[INFO]WiFiTask: WiFi Task Start…
[INFO]WiFiTask: EHCI Ready…
[INFO]MLME_ModeInit: DEV MAC ec:3d:fd:21:37:fc
[INFO]Set Wifi channel(1)
[INFO]WiFiTask: Wifi Initail OK…
[INFO]WiFi Station Mode Initial Started…
[INFO]Set Wifi channel(1)
[INFO]Set Wifi channel(4)
[INFO]Set Wifi channel(7)
[INFO]Set Wifi channel(10)
[INFO]Set Wifi channel(13)
[INFO]Set Wifi channel(3)
[INFO]Set Wifi channel(5)
[INFO]Set Wifi channel(9)
[INFO]Set Wifi channel(12)
[INFO]Set Wifi channel(2)
[INFO]Set Wifi channel(6)
[INFO]Set Wifi channel(8)
[INFO]Set Wifi channel(11)
[INFO]Set Wifi channel(11)
[INFO]ScanSmartConfigBeacon: Get Beacon Info Done! Auth(7), Enc(3), Channel(11)
[INFO]Set Wifi channel(11)
[INFO]ParseBeacon: Found matched SSID (MySSIDwasHere)
[WARN]MGMTENTRY_Add: Add Node failed: Exist Node
[INFO]ProbeRsp from C8-3A-35-58-C4-A1
[INFO]Auth to C8-3A-35-58-C4-A1
[INFO]Auth from C8-3A-35-58-C4-A1
[INFO]Assoc to C8-3A-35-58-C4-A1
[INFO]SendAssocReq: Using WPA2 - Authmode = 7, RSN len = 20
[INFO]Auth from C8-3A-35-58-C4-A1
[INFO]Auth from C8-3A-35-58-C4-A1
[INFO]Assoc from C8-3A-35-58-C4-A1
[INFO]RTMPCheckAssociation: Connected to AP = C8-3A-35-58-C4-A1, channel (11)
[INFO]AsicAddPairwiseKeyEntry: WCID 1 Alg=AES
[INFO]PeerPairMsg3Action: AuthMode(WPA2PSK) PairwiseCipher(AES) GroupCipher(AES)
[INFO]Start DHCP…ret = 0

If working, the viper will print its IP address after a few seconds. When not working, nothing is printed

we could add the IP as an option in WIFI.TXT, instead of using DHCP
I used dhcp as I though it would be easier for swarming to have the same microSD contents on every copter

Definitely, much easier with dhcp. But option would be nice too :wink:

Yes, the app did prompt me to upgrade out-of-the-box. But I didn’t have a microSD card that day so I had declined.

The SSID was “Flying Fluffball” with a password of “Potato92!”, which doesn’t seem all that exotic. I could not break it again with either old or new firmware.

I encountered no issues factory resetting over and over again while interrupting it at various times. I suppose it was just a one-time glitch unless it somehow happens again and I better remember what actions lead to it.

Thanks Kevin. I don’t have it hardwired via USB right now so can’t see much. But will solder soon …

I upgraded from an old (8/26) version and after that the network disappeared, so now I know WIFI.TXT is read. Doubt it’s the SD card, when in access mode I can see the file system fine. But can never see WIFI.TXT since I have wifi connection only … It’s got to be something with dhcp, weird thing though is that it won’t access either a wifi router or my phone as hotspot. I also tried re-formatting and downloading from the web server, but no different. And could see WIFI.TXT just fine before rebooting.

Interesting that you have it working tethered to your phone but not your router. Definitely must have something to do with dhcp … Probably same with me, but can’t explain why it wouln’t work with my phone either. Console will hopefully tell!

When trying with one of the routers (Netgear Nighhawk), I had my computer listening in with Wireshark. I saw the viper broadcast DHCP DISCOVERs every few seconds, so that could be one way to check whether association was successful.

However, the router itself did not log that it received any DISCOVERs (and sent back OFFERs) like they did with my phone and other devices.

Problem solved, it was the SD card(s) … 4GB Sandisk no name, 16GB Sandisk no name, no go. 16GB Sandisk Extreme+, 32GB Sandisk Extreme+, works like a charm. What threw me off is that all work with access mode, upgrading, show photos, videos, etc … But the first two just won’t do station mode. Also I’ve had problems just formatting a card and adding WIFI.TXT station mode if not by the web interface.

In my case when it didn’t work sniffing didn’t help. I could not see anything, no ARP, DHCP, MAC address, no nothing from the Viper(s).

hmm, interesting, I wonder if there is a timing issue with the speed of mount of the microSD?
I’m actually surprised at the level of interest in station mode. Now that I know people are interested, I could look at a different method of setting it up.
The reason I used WIFI.TXT instead of just putting it in the video board NVRAM parameters is I needed to give some way to recover in case it didn’t work. As there is no button on the copter the obvious method was the microSD.
I could do something like have a setting in the NVRAM interface in the web page, but it only activates if it has been enabled in the web interface and the drone is booted while upside down. Would that be better?

Another possibility is to have a setup page for station mode in the web interface, and have a “test” button. That would enable station mode for N minutes (you’d choose for how long in the web UI). Then once you know its all OK you could make it permanent with another button.

Problem solved, it was the SD card(s) … 4GB Sandisk no name, 16GB Sandisk
no name, no go. 16GB Sandisk Extreme+, 32GB Sandisk Extreme+, works like a
charm. What threw me off is that all work with access mode, upgrading, show
photos, videos, etc … But the first two just won’t do station mode. Also

Wow! That’s some persistence, right there.

My guess is a race condition - some cards being faster to detect than
others.