Can't connect over WiFi in Atom
So in my code I set the wifi on boot to be false to save battery life. But my pycom device will eventually be installed in a device that won't allow easy access to the usb port. So to get around this I want to be able to connect to it over wifi and upload code through wifi if needed. So I've written a case where my server can send a command to the dive to issue this command
This shows up perfectly in my wifi list and I connect to it fine. But when I try to connect to it with atom I get an error
Connecting on 192.168.4.1...
Failed to connect (Connection refused). Click here to try again.
Any ideas why I can't connect through atom/pymkr and upload new code to the device?
I tried with filezilla and I'm able to send files over FTP which is good enough to get me by. Not sure why atom/pymaker is having issues but I've got something that works. I'll count that as a win.
Alright making some progress. I've used the nvram to set a flag in my boot.py to turn the wifi on boot to true. I'm able to connect to the gpy wifi but when I try to upload code to the device over wifi I get this error.
Connecting on 192.168.4.1... Uploading project (main folder)... Upload failed.: timeout Please reboot your device manually. Waiting for reboot... Connecting on 192.168.4.1... Connecting on 192.168.4.1...```
@tuftec thinks for the lead on the nvram idea. I might look into toggling the wifi on boot based on the nvram value. Sounds like this could solve my problem potentially.
@Martinnn I'm having issues with FTP also. I'm using Filezilla on OSX and it wasn't able to connect. I set the wifi to be an access point and used the default IP of 192.168.4.1.
@Fin Can you connect via FTP?
Are you sure the IP address is correct? I guess your router should list it in its connection or ARP table.
I recall that I found something similar when I was trying to disable/enable the wifi on boot using a push button.
I had to perform this operation in the boot code rather than main.
Maybe you could simply set a flag in nvram and then just reboot from your application. When the code boots, you can check the flag in the boot module and then enable/disable the wifi then.