Search found 32 matches

by cemox
Sat May 02, 2020 7:15 am
Forum: General Discussion and Questions
Topic: uasyncio : Cancelling a task
Replies: 5
Views: 526

uasyncio : Cancelling a task

I am trying to cancel a task and start a new one (with new parameters). (Board ESP8266, latest Mciropython from Master Branch in github) import uasyncio as asyncio async def delayN(n): while (True): print("delay for {} seconds".format(n)) await asyncio.sleep(n) async def delay1(): while (True): prin...
by cemox
Sat May 02, 2020 5:06 am
Forum: Programs, Libraries and Tools
Topic: VS1053 asynchronous socket read
Replies: 4
Views: 435

Re: VS1053 asynchronous socket read

Thank you. I am using

Code: Select all

reader, writer = await asyncio.open_connection(host, port)
in my function now.
by cemox
Fri May 01, 2020 3:37 pm
Forum: ESP8266 boards
Topic: What makes WiFi config persistent?
Replies: 6
Views: 2990

Re: What makes WiFi config persistent?

Thank you, it works.
by cemox
Thu Apr 30, 2020 8:25 am
Forum: ESP8266 boards
Topic: What makes WiFi config persistent?
Replies: 6
Views: 2990

Re: What makes WiFi config persistent?

Yesterday, I compiled the latest version of micropython for ESP8266 and I started seeing this annoying output in repl repeatedly: connected with Cisti, channel 1 dhcp client start... ip:192.168.1.4,mask:255.255.255.0,gw:192.168.1.1 state: 5 -> 2 (22c0) rm 0 reconnect state: 2 -> 0 (0) scandone state...
by cemox
Tue Apr 28, 2020 11:28 am
Forum: Programs, Libraries and Tools
Topic: VS1053 asynchronous socket read
Replies: 4
Views: 435

VS1053 asynchronous socket read

I am building a simple internet radio with my ESP8266 Lolin Board + VS1053 board. The code below works (I removed irrelevant parts of the code): from machine import Pin, SPI import utime import socket hspi = SPI(1, baudrate=2000000) #2M is good url = 'http://mp3channels.webradio.antenne.de/chillout'...
by cemox
Tue Apr 28, 2020 11:15 am
Forum: Programs, Libraries and Tools
Topic: How to check socket binding is done or not?
Replies: 2
Views: 528

Re: How to check socket binding is done or not?

Sorry, I forgot to tell. It is ESP8266 (Lolin) board. Thanks for your reply. I solved it by calling the connect() function a couple of times repeatedly, it works somehow.
by cemox
Sun Mar 15, 2020 9:57 am
Forum: Programs, Libraries and Tools
Topic: How to check socket binding is done or not?
Replies: 2
Views: 528

How to check socket binding is done or not?

Hi, I have a function that creates a socket for UDP connection and it works fine. def connect(): conn = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # server_address = (ip, port) print ('starting up on %s port %s' % server_address) conn.bind(server_address) conn.settimeout(0) # conn.settimeout(N...
by cemox
Wed Jun 05, 2019 10:50 am
Forum: Programs, Libraries and Tools
Topic: retrieving data from coro (esp822)
Replies: 3
Views: 665

Re: retrieving data from coro (esp822)

I actually went through your tutorial and your GPS solution, but I think I should check them once more in detail. Thank you.
by cemox
Tue Jun 04, 2019 3:25 pm
Forum: Programs, Libraries and Tools
Topic: retrieving data from coro (esp822)
Replies: 3
Views: 665

retrieving data from coro (esp822)

Hi, I have managed to read GPS data from UART0 (disabling REPL when reading) and write to UART1 (tx only) on my ESP8266 Lolin board. Using coro's solved lots of problems (thanks to Peter Hinch's fantastic library and tutorial). But, for the time being the "receiver" coro updates the global variables...
by cemox
Wed Jan 02, 2019 8:56 am
Forum: General Discussion and Questions
Topic: UART serial flush (!)
Replies: 7
Views: 2145

Re: UART serial flush (!) SOLVED

I solved it by making a modification to machine_uart.c file as this : I added internal function call uart_flush(self->uart_id); into uart.write function in machine_uart.c file as shown below: STATIC mp_uint_t pyb_uart_write(mp_obj_t self_in, const void *buf_in, mp_uint_t size, int *errcode) { pyb_ua...