Atom to lopy via wifi
-
Tried to access lopy4 ad hoc wifi via the 192.168.4.1 option in Atom, something we've done successfully in the past. When it didn't work this time
Connecting to 192.168.4.1... Connection error: Error: Login timed out
we tried Filezilla
Status: Connecting to 192.168.4.1:21... Status: Connection established, waiting for welcome message... Status: Plain FTP is insecure. Please switch to FTP over TLS. Status: Server does not support non-ASCII characters. Status: Logged in Status: Retrieving directory listing... Command: PWD Response: 257 / Command: TYPE I Response: 200 Command: PASV Response: 227 (192,168,4,1,7,232) Command: LIST Response: 150 Error: The data connection could not be established: ECONNREFUSED - Connection refused by server Error: Connection timed out after 20 seconds of inactivity Error: Failed to retrieve directory listing Status: Disconnected from server
Does anyone see a clue in there on what's wrong? We've tried several different wipy/lopy so we don't think it's the pycom devices.
-
@g0hww Sounds like a nice setup & you're right, if I change the ip address in Atom settings I can find the lopy on the home wifi network, so much nicer than wifi direct via the ad hoc.
-
@kjm said in Atom to lopy via wifi:
Do I read your post correctly? Is Atom on linux able to access your lopy over wifi via your router?
Yes, exactly. That said, I don't tend to do use telnet/FTP often. My Lopy4's send a lot of data to an MQTT broker on my Linux box, via the WLAN,
I have one with a Pytrack board that sends its position in an encrypted and signed payload over LoRa, and will provide telemetry via MQTT if it is able to connect to the WLAN. The other two act as BLE and LoRa gateways, publishing data from Tempo Disc temp sensors and stuff received over LoRa to the broker. One of these is out in the shed.
I had been working on introducing HomeAssistant compatibility with the MQTT data when the pandemic struck, but that's on holds now, as I left home in March 2020 and haven't been back since.
-
@g0hww I'm normally happy with Atom via USB too. It's just for this particular bit of code development I need the lopy outside & the 192.168.4.1 connect option for Atom access is more convenient than running a 5m USB cable out the window. Seems to be working OK now the Windows10 firewall is disabled for the ad hoc wifi.
Do I read your post correctly? Is Atom on linux able to access your lopy over wifi via your router? That would be my preferred option. I was thinking of trying VisualStudio as an Atom alternative to see if it can do wifi acces to the lopy via a router but it would be a big step after a couple of years getting comfortable with Atom. Maybe I should be trying Atom in a linux VM?
-
@kjm Interesting. I use Atom here, on Linux. I just used plain old telnet and connected fine to one of my devices, and via telnet with Atom to another. Both seem fine. PC here is hooked up via Gig-E and the Lopy4s are hooked up to the WLAN.
Pinging one of them does show some variability in response time though.
--- 192.168.1.27 ping statistics ---
62 packets transmitted, 62 received, 0% packet loss, time 61079ms
rtt min/avg/max/mdev = 1.811/2.781/16.528/2.059 msMy Lopy4's are running 1.20.2.rc3. I will admit to preferring a serial/USB connection for managing the devices myself, but that comes from the time I was running pre-refactored code and I had all sorts of problems.
Can you monitor the device using serial/USB whilst attempting to connect over wifi to see what is going on?
-
@g0hww Tried that & it works for Filezilla but 192.168.4.1 via ad hoc is the only option for Atom. Anyway, after a lot of googling, we found typing 'firewall & network' (not 'firewall and network' or 'network & firewall' or 'network and firewall') at start let us switch off the firewall for a public ad hoc & we're back in business with Atom.
Sure would be nice if Atom could connect through the router, having no internet during development because your PC has to be on an ad hoc wifi for wireless connection to your dev board is a pain.
-
Are you connecting to the Lopy directly, with it running as an AP? Why not configure the Lopy to connect to your WLAN as a client?
-
@g0hww It's something to do with my new Windows10 PC. Atom & Filezilla both work via 192.168.4.1 from my old Windows7 languishing here in the corner but for some reason the the new PC seems to have issues. I tried pinging the lopy from the Windows cmd prompt & it's very iffy
Pinging 192.168.4.1 with 32 bytes of data: Request timed out. Request timed out. Request timed out. Reply from 192.168.4.1: bytes=32 time=1ms TTL=255 Ping statistics for 192.168.4.1: Packets: Sent = 4, Received = 1, Lost = 3 (75% loss), Approximate round trip times in milli-seconds: Minimum = 1ms, Maximum = 1ms, Average = 1ms
considering the 2 antennas are only 1m apart? I wonder if it's something to do with the wifi card in the new m/c being dual frequency? It's always connects to the router on 5GHz, this is the first time I've tried 2.4GHz, maybe the low freq is dodgy?
-
@kjm I don't have recent experience of the issue you describe, but a couple of years ago, I had some similar issues and I learned that a fairly busy LoPy seemed to affect telnet connectivity. Introducing some sleeps into the code to ensure that user written code didn't hog all the CPU time seemed to help.
I haven't had much need to use telnet/FTP recently though, and my code went through a substantial refactoring and its stability is now such that the devices haven't needed any attention in over a year.