Update: I found this...
http://docs.micropython.org/en/v1.8.6/w ... reset.html
Will test on my set up.
Search found 23 matches
- Fri Mar 01, 2019 3:41 pm
- Forum: ESP8266 boards
- Topic: Getting the ESP8266 to reboot micropython itself... possible?
- Replies: 1
- Views: 3448
- Fri Mar 01, 2019 3:36 pm
- Forum: ESP8266 boards
- Topic: Getting the ESP8266 to reboot micropython itself... possible?
- Replies: 1
- Views: 3448
Getting the ESP8266 to reboot micropython itself... possible?
Hi All OK, so this may already be possible, apologies I am fairly new to the world of python and micropython. So, I have successfully flashed micropython to several of my ESP8266 boards and have one set up and running with a BME280 environment sensor connected, uploading data to Adafruit.io. However...
- Fri Feb 22, 2019 9:35 pm
- Forum: General Discussion and Questions
- Topic: Wanting to send data with different intervals
- Replies: 10
- Views: 7065
Re: Wanting to send data with different intervals
time.ticks_ms is a method only available in micropython, not on your pi. on your pi you can use time.time() which returns seconds so you have to replace the 3000ms in my example with 3s. Think I figured it out... don't need the last sleep line. import time temp = 20 press = 1021 last_task1=time.tim...
- Fri Feb 22, 2019 9:18 pm
- Forum: General Discussion and Questions
- Topic: Wanting to send data with different intervals
- Replies: 10
- Views: 7065
Re: Wanting to send data with different intervals
time.ticks_ms is a method only available in micropython, not on your pi. on your pi you can use time.time() which returns seconds so you have to replace the 3000ms in my example with 3s. So I tried this with some amended Python code Kevin, and get not the results I expected... import time temp = 20...
- Fri Feb 22, 2019 9:10 pm
- Forum: General Discussion and Questions
- Topic: Wanting to send data with different intervals
- Replies: 10
- Views: 7065
Re: Wanting to send data with different intervals
time.ticks_ms is a method only available in micropython, not on your pi. on your pi you can use time.time() which returns seconds so you have to replace the 3000ms in my example with 3s. Aha... now I understand, super explanation thanks, Kevin. The programme I am actually using to send the data to ...
- Fri Feb 22, 2019 7:43 pm
- Forum: General Discussion and Questions
- Topic: Wanting to send data with different intervals
- Replies: 10
- Views: 7065
Re: Wanting to send data with different intervals
You might be right. By the way, don't disconnect from mqtt if you don't have a good reason to do so. I tried this code in my test set up on the Pi... and get an error Kevin... any advice please? Traceback (most recent call last): File "/home/pi/Documents/john_count.py", line 7, in <module> last_tas...
- Fri Feb 22, 2019 7:33 pm
- Forum: General Discussion and Questions
- Topic: Wanting to send data with different intervals
- Replies: 10
- Views: 7065
Re: Wanting to send data with different intervals
You might be right. You can do something like this: last_task1=time.ticks_ms() last_task2=time.ticks_ms() while True: if time.ticks_ms()-last_task1>=3000: # publish data of task1 every 3 seconds c.publish(...) if time.ticks_ms()-last_task2>=8000: # publish data of task2 every 8 seconds c.publish(.....
- Fri Feb 22, 2019 6:04 pm
- Forum: General Discussion and Questions
- Topic: Wanting to send data with different intervals
- Replies: 10
- Views: 7065
Re: Wanting to send data with different intervals
Thanks Kevin, this is certainly something I will add to my 'need to learn' list, but might be a tad overkill for my needs just now. I have managed to write some test code on the Pi using IDLE that seems to do the trick; a little tidying up and I think I can add this to my ESP32 MicroPython code. imp...
- Fri Feb 22, 2019 5:39 pm
- Forum: General Discussion and Questions
- Topic: Wanting to send data with different intervals
- Replies: 10
- Views: 7065
Wanting to send data with different intervals
So I have the following MicroPython code in my script, running on an ESP32, which uploads the data from a BME environment sensor to my Adafruit feed once a minute, however, for the 'pres' variable, I don't need to send that data up to my feed anywhere near as often. I'm very new to Python, and am wo...
- Mon Feb 18, 2019 8:33 pm
- Forum: General Discussion and Questions
- Topic: Error when flashing ESP32 - Testing if ubinascii.unhexlify exists ...
- Replies: 17
- Views: 10934
Re: Error when flashing ESP32 - Testing if ubinascii.unhexlify exists ...
It's --flash_size 4MB Hey Robert... I owe you a beer! or wine! or gin! Well, well well... would you believe it... this command... esptool.py --port /dev/cu.SLAB_USBtoUART --baud 115200 write_flash --verify --flash_size=4MB -fm dout 0 Desktop/esp8266-20190125-v1.10.bin ...actually worked on the Wemo...