I don't believe there is any requirement for network.WLAN to inform the router it's going away. You should see similar behaviour if you just unplugged the device.
Curt
Search found 25 matches
- Sat Jul 30, 2022 6:19 pm
- Forum: General Discussion and Questions
- Topic: Force network.WLAN module to disconnect?
- Replies: 5
- Views: 2534
- Sat Jul 30, 2022 6:12 pm
- Forum: General Discussion and Questions
- Topic: Web server In/out + physical button control via gpio
- Replies: 14
- Views: 11068
Re: Web server In/out + physical button control via gpio
I did something similar to this. You could do use the following pseudo code:
Curt
Code: Select all
while True :
# Test for button pushed, save result
# read/poll web request with zero time out
# If request is present return reply
# sleep for 100ms
- Wed Jul 27, 2022 4:08 am
- Forum: General Discussion and Questions
- Topic: Traffic lights with a button interrupt - how would you have done it?
- Replies: 12
- Views: 9821
Re: Traffic lights with a button interrupt - how would you have done it?
The traffic light application is interesting. I developed an example application for a module I am developing. It can be found here: https://github.com/ctimmer/poll-looper You only need: poll_looper.py and example/trafficlights.py (app) It was written for micropython but it runs on my raspberry pi (...
- Tue Jul 26, 2022 7:55 pm
- Forum: General Discussion and Questions
- Topic: Using machine Pin class no way to get pin number or channel when running on Pi Pico?
- Replies: 7
- Views: 9998
- Fri Jul 22, 2022 2:50 pm
- Forum: Programs, Libraries and Tools
- Topic: urequest could not request the server after short downtime
- Replies: 2
- Views: 1830
Re: urequest could not request the server after short downtime
I would verify that the server is actually running (listening). If it was only down briefly, the restart could have failed trying to open the port because the port was in a TIME_WAIT state.
Curt
Curt
- Wed Jul 20, 2022 2:46 pm
- Forum: General Discussion and Questions
- Topic: Not Looking for suggestions any more
- Replies: 2
- Views: 1659
Re: Looking for suggestions
Have you considered a network solution, even if to get your project going. I use UDP a lot. It's fast with fairly low overhead. One of the devices could be an access point eliminating the need for external hardware.
Curt
Curt
- Sat Jul 02, 2022 6:59 pm
- Forum: Programs, Libraries and Tools
- Topic: Plotting data on a webpage
- Replies: 3
- Views: 2102
Re: Plotting data on a webpage
A better approach would probably be to let your browser do the plotting with an application like 'flot'. Flot used to require JQuery but it can be run stand alone. The micropython server would only have to return the data array (json).
Curt
Curt
- Sat Jul 02, 2022 5:17 pm
- Forum: Programs, Libraries and Tools
- Topic: JSON serialisation
- Replies: 5
- Views: 3968
Re: JSON serialisation
Using your example:
There are other ways to organize this data.
curt
Code: Select all
item = {'Name' : 'cleanRoom',
'Description' : 'Clean my room',
'IsComplete' : False}
curt
- Sat Jul 02, 2022 3:45 pm
- Forum: Programs, Libraries and Tools
- Topic: JSON serialisation
- Replies: 5
- Views: 3968
Re: JSON serialisation
I believe json serialization is looking for a dictionary or array. I've always used a dictionary.
Curt
Curt
- Mon Jun 20, 2022 6:26 pm
- Forum: Programs, Libraries and Tools
- Topic: micropython/python3 compatible modules
- Replies: 2
- Views: 1659
Re: micropython/python3 compatible modules
Thanks @jimmo for your suggestions and explanations they were very helpful. I decided to go with "sys.implementation.name" as the most direct way to determine which python is running the application. Testing modules works but module implementation can change over time. Adding methods to modules appe...