Search found 25 matches

by curt
Sat Jul 30, 2022 6:19 pm
Forum: General Discussion and Questions
Topic: Force network.WLAN module to disconnect?
Replies: 5
Views: 2524

Re: Force network.WLAN module to disconnect?

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
by curt
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: 11036

Re: Web server In/out + physical button control via gpio

I did something similar to this. You could do use the following pseudo code:

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
Curt
by curt
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: 9796

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 (...
by curt
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: 1825

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
by curt
Wed Jul 20, 2022 2:46 pm
Forum: General Discussion and Questions
Topic: Not Looking for suggestions any more
Replies: 2
Views: 1655

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
by curt
Sat Jul 02, 2022 6:59 pm
Forum: Programs, Libraries and Tools
Topic: Plotting data on a webpage
Replies: 3
Views: 2096

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
by curt
Sat Jul 02, 2022 5:17 pm
Forum: Programs, Libraries and Tools
Topic: JSON serialisation
Replies: 5
Views: 3957

Re: JSON serialisation

Using your example:

Code: Select all

item = {'Name' : 'cleanRoom',
	'Description' : 'Clean my room',
	'IsComplete' : False}
There are other ways to organize this data.
curt
by curt
Sat Jul 02, 2022 3:45 pm
Forum: Programs, Libraries and Tools
Topic: JSON serialisation
Replies: 5
Views: 3957

Re: JSON serialisation

I believe json serialization is looking for a dictionary or array. I've always used a dictionary.
Curt
by curt
Mon Jun 20, 2022 6:26 pm
Forum: Programs, Libraries and Tools
Topic: micropython/python3 compatible modules
Replies: 2
Views: 1649

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...