Search found 3367 matches

by pythoncoder
Fri May 10, 2019 9:53 am
Forum: ESP8266 boards
Topic: How to switch on a electric bulb with ESP8266 board?
Replies: 22
Views: 483

Re: How to switch on a electric bulb with ESP8266 board?

jimmo wrote:
Fri May 10, 2019 2:55 am
Also just a reminder that in many countries (e.g. Australia) it's illegal to DIY mains electricity...
I never knew that. I wonder how these maniacs manage? ;)
by pythoncoder
Thu May 09, 2019 4:39 pm
Forum: Programs, Libraries and Tools
Topic: I'm searching a modbus library
Replies: 6
Views: 164

Re: I'm searching a modbus library

This is something of a FAQ and there is evident interest in a library. As far as I can see the Pyboard could support Modbus but nobody has written a library. It needs someone with access to a Modbus master to roll up their sleeves and get coding.
by pythoncoder
Thu May 09, 2019 4:22 pm
Forum: General Discussion and Questions
Topic: Structured prog & global variables
Replies: 8
Views: 201

Re: Structured prog & global variables

Actually this is a strength of Python. If you issue import my_module you have a guarantee that the only name added to your namespace is my_module : names within the module a guaranteed not to conflict with your own because you have to prepend them with the module name: import my_module x = my_module...
by pythoncoder
Thu May 09, 2019 6:15 am
Forum: ESP32 boards
Topic: Can't connect WiFi after restart
Replies: 9
Views: 220

Re: Can't connect WiFi after restart

This is very odd and I've never seen this; it looks rather like some router/AP behaviour as if it hasn't acknowledged the fact of disconnection. I wonder if the behaviour can be replicated with other WiFi devices? Perhaps a long shot but it might be worth repeating the attempt for a period - in this...
by pythoncoder
Thu May 09, 2019 5:47 am
Forum: General Discussion and Questions
Topic: Structured prog & global variables
Replies: 8
Views: 201

Re: Structured prog & global variables

The advice about avoiding globals is undoubtedly correct. Access is relatively slow. But there are other reasons rooted in general programming practice which you can research online. It's worth understanding Python's scoping rules. If a module has a global name (whether for data or for an object suc...
by pythoncoder
Tue May 07, 2019 10:05 am
Forum: ESP8266 boards
Topic: ESP8266 goes down after sometime [SOLVED]
Replies: 21
Views: 470

Re: ESP8266 goes down after sometime

Given that your main loop runs every 180s I think you need to change the WDT time from 120s to (say) 300s. You should then be able to place the feed() statement in your main loop. I'd suggest after the while(True) statement. The way a WDT works is that it resets the board if it is not fed during its...
by pythoncoder
Tue May 07, 2019 9:55 am
Forum: Development of MicroPython
Topic: Run more than one micropython instance
Replies: 30
Views: 7555

Re: Run more than one micropython instance

I can't see how this would work. As far as I can see only one instance can use a device at any one time. If data arrives on a UART, the device driver can't "know" where to send it unless the data itself contains that information. Consider Linux. My understanding is that if a process opens a serial d...
by pythoncoder
Mon May 06, 2019 6:52 am
Forum: Development of MicroPython
Topic: Run more than one micropython instance
Replies: 30
Views: 7555

Re: Run more than one micropython instance

... - How much effort might it take to ensure that hardware peripherals all have some sort of lock to prevent simultaneous access? ... This is decidedly nontrivial. Consider peripherals like UARTs and Pins which raise IRQ's. If multiple instances are using the same device, the only way to ensure th...
by pythoncoder
Sun May 05, 2019 5:53 pm
Forum: ESP32 boards
Topic: "utime.strftime" problem converting Hour
Replies: 3
Views: 104

Re: "utime.strftime" problem converting Hour

jimmo wrote:
Fri May 03, 2019 11:20 pm
...Just for my own curiosity, I looked briefly but I actually don't see strftime implemented in the utime module? What am I missing? Is your board running stock MicroPython firmware?
Quite. I've never seen it implemented and it certainly isn't in the docs.
by pythoncoder
Sun May 05, 2019 5:45 pm
Forum: ESP8266 boards
Topic: ESP8266 goes down after sometime [SOLVED]
Replies: 21
Views: 470

Re: ESP8266 goes down after sometime

I notice you're using `umqtt.simple`. This really isn't suitable for long term use because it does not properly recover from WiFi outages. Brief outages can occur for various reasons including bursts of RF interference. You might like to read this - follow the link to the resilient driver. Also thes...