Search found 738 matches

by kevinkk525
Sat Jul 11, 2020 6:03 pm
Forum: ESP8266 boards
Topic: Need to migrate project--Please suggest
Replies: 3
Views: 46

Re: Need to migrate project--Please suggest

both links are for pyboard, esp8266 and esp32 and partly even the unix port.
You dont need to do any changes.
by kevinkk525
Sat Jul 11, 2020 3:48 pm
Forum: Drivers for External Components
Topic: MQ sensors
Replies: 3
Views: 37

Re: MQ sensors

I once bought a MQ-5 too to detect gas in my appartment. Never got it implemented though.. This link was interesting for me: https://osoyoo.com/2018/11/15/arduino-lesson-mq-5-gas-sensor/ From that page: The sensor value only reflects the approximated trend of gas concentration in a permissible error...
by kevinkk525
Sat Jul 11, 2020 3:41 pm
Forum: ESP8266 boards
Topic: Need to migrate project--Please suggest
Replies: 3
Views: 46

Re: Need to migrate project--Please suggest

Can't say anything about the accelerometer but for sending messages between micropython and a python server I can recommend this project: https://github.com/peterhinch/micropython-iot It provides a reliable client-server connection, so you don't have to worry about that. However, it uses uasyncio so...
by kevinkk525
Fri Jul 10, 2020 10:05 am
Forum: General Discussion and Questions
Topic: [SOLVED] time.time() very inaccurate when using uasyncio
Replies: 8
Views: 173

Re: [SOLVED] time.time() very inaccurate when using uasyncio

The relevant source for time.time() is here: https://github.com/micropython/micropython/blob/073b9a5eb888b26be7ce4c65e9649b6c3857ba39/ports/esp8266/machine_rtc.c#L99 (this function is called in time.time() in modutime.c that @peterhinch linked to) As I understand it, it uses the rtc directly for thi...
by kevinkk525
Fri Jul 10, 2020 7:02 am
Forum: General Discussion and Questions
Topic: [SOLVED] time.time() very inaccurate when using uasyncio
Replies: 8
Views: 173

Re: time.time() very inaccurate when using uasyncio

the accuracy of time.time() should be the same with or without uasyncio. uasyncio doesnt change the time and it uses ticks_ms() internally.
The rtc accuracy of the esp8266 generally is horrible but not 3 secs per minute usually. Maybe try a different board and see if it behaves better.
by kevinkk525
Tue Jul 07, 2020 1:15 pm
Forum: Programs, Libraries and Tools
Topic: Is Lobo build repo current?
Replies: 2
Views: 93

Re: Is Lobo build repo current?

The lobo repo has many esp32 specific features that the main micropython repo only got recently or didn't yet implement at all (because it is more difficult if you have to implement things that have to be consistent over multiple ports and not only the esp32). Therefore the lobo port might still be ...
by kevinkk525
Sun Jul 05, 2020 2:43 pm
Forum: Drivers for External Components
Topic: uasyncio and display
Replies: 12
Views: 229

Re: uasyncio and display

I'm glad it works now! by the way: the last 2 lines are not needed in your code: import machine import uasyncio as asyncio from pms.pms5003 import PMS5003 import pms.pms5003 import time import epaper2in9 from pyb import SPI import pyb # SPI3 on Black STM32F407VET6 spi = SPI(2, SPI.MASTER, baudrate=2...
by kevinkk525
Sun Jul 05, 2020 7:54 am
Forum: Drivers for External Components
Topic: uasyncio and display
Replies: 12
Views: 229

Re: uasyncio and display

Hi, I have the return : "AttributeError: 'module' object has no attribute 'run' " I will try to replace the "loop_run_forever" command by " uasyncio.get_event_loop()" in a "while True" boucle... Ah yes, sorry. the asyncio.run() works only with uasyncio version 3. For version 2 you need to use loop=...
by kevinkk525
Sun Jul 05, 2020 5:22 am
Forum: Drivers for External Components
Topic: uasyncio and display
Replies: 12
Views: 229

Re: uasyncio and display

uasyncio v3 would be even better, a tutorial for that can be found: https://github.com/peterhinch/micropyth ... /README.md

It is very similar to the asyncio module in Python on your computer, so most basic tutorials will work the same as on micropython.
by kevinkk525
Sat Jul 04, 2020 7:02 pm
Forum: Drivers for External Components
Topic: uasyncio and display
Replies: 12
Views: 229

Re: uasyncio and display

import uasyncio as asyncio uart = machine.UART(4, baudrate=9600) pm = PMS5003(uart, lock) pm.registerCallback(display_values) import epaper2in9 from pyb import SPI import pyb # SPI3 on Black STM32F407VET6 spi = SPI(2, SPI.MASTER, baudrate=2000000, polarity=0, phase=0) cs = pyb.Pin('Y7') dc = pyb.Pi...