BeyondRobotix / mavesp8266

ESP8266 WiFi Access Point and MAVLink Bridge
Other
182 stars 173 forks source link

how usable is STA mode? #47

Closed tve closed 6 years ago

tve commented 6 years ago

Updated issue: I initially opened this as "enabling debug log on GPIO2 causes crash" but after some further troubleshooting I believe it has to do with maving set wifi_mode=1 (STA).

After enabling STA mode enabling debug log on GPIO2 causes crash. I clone the repo as-is, uncommented the line in mavesp8266.h to define ENABLE_DEBUG, and it crashes as soon as client connects:

Configuring access point...
Free Sketch Space: 159744
Waiting for a client...
Got 1 client(s)
Start WiFi Bridge
Local IP: 192.168.4.1

Exception (0):
epc1=0x40106d51 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont
sp: 3fff5ca0 end: 3fff6040 offset: 01a0

>>>stack>>>
3fff5e40:  0000001c 00000000 3fff4f50 401004d8
3fff5e50:  00000000 00000000 3fff6a44 4020345d
...
tve commented 6 years ago

I'm having difficulties getting STA mode to actually function.

If I don't provide a static IP then it's practically impossible to connect to mavesp8266 because it sets the MDNS hostname to mavesp8266-, which IMHO makes no sense 'cause DNS is there to find the IP address, but now I need to know the IP address to find the DNS name.

If I comment out https://github.com/dogmaphobic/mavesp8266/blob/master/src/mavesp8266_vehicle.cpp#L59 (starting the serial) then it doesn't crash in STA mode. I am running without a pixracer connected (hard to load esp8266 firmware and troubleshoot when it's on the pixracer), so there's nothing sensible coming in on serial. But in AP mode it doesn't crash.

tve commented 6 years ago

I finally figured it out. Somehow the baud rate got set to 0 in the parameters. Possibly operator error... Would be good to have a check there 'cause Serial.begin(0) causes an exception.