asynycio as_GPS
Posted: Mon Jan 06, 2020 10:09 am
os.uname()
(sysname='LoPy', nodename='LoPy', release='1.20.1.r2', version='v1.11-06dfad0 on 2019-11-30', machine='LoPy with ESP32', lorawan='1.0.2', pybytes='1.3.0')
For a project for motorcyclists I need current GPS data.
First step is to determine and record data for the simulation during the ride.
I found the wonderful libraries of Peter Hinch. Isn't he also a motorcyclist?
I use
uasyncio in the fast_io version
as_GPS
os.listdir("as_GPS")
>['as_GPS.py', 'as_GPS_utils.py', 'as_rwGPS.py']
>
>asyncio works in simple tests.
>
>But as_GPS does not want to instantiate:
gps = as_GPS.AS_GPS(sreader, fix_cb=callback) # Instantiate GPS
AttributeError: 'module' object has no attribute 'AS_GPS'
>I can't find any typos.
>No difference when using the original uasyncio version
I posted this topic at Pycom-forum some days ago.
My hope is, that Peter Hinch will read this topic here.
Same Problem on other hardware (FiPy)
precompiling to -.mpy-files made no difference
Thank you for help...
>(DeepL helped me to translate)
>
>
>(2020, 1, 4, 11, 6, 55, 480879, None)
>Pycom MicroPython 1.20.1.r2 [v1.11-06dfad0] on 2019-11-30; LoPy with ESP32
>Pybytes Version: 1.3.0
>Type "help()" for more information.
import uasyncio as asyncio
import as_GPS
from machine import UART
uart= UART(1, baudrate=9600, pins=('P20','P21'))
sreader = asyncio.StreamReader(uart) # Create a StreamReader
gps = as_GPS.AS_GPS(sreader, fix_cb=callback) # Instantiate GPS
>Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
>AttributeError: 'module' object has no attribute 'AS_GPS'
i don think, it is not a memory problem:
see this test on FiPy
Pycom MicroPython 1.20.1.r2 [v1.11-06dfad0] on 2019-11-30; FiPy with ESP32
Pybytes Version: 1.3.0
Type "help()" for more information.
>>> import gc
>>> gc.mem_free()
2549728
>>> import uasyncio as asyncio
>>> gc.mem_free()
2533104
>>> import as_GPS
>>> gc.mem_free()
2532832
>>> uart= UART(1, baudrate=9600, pins=('P20','P21'))
>>> gc.mem_free()
2532480
>>> sreader = asyncio.StreamReader(uart)
>>> gc.mem_free()
2532256
>>> gps = as_GPS.AS_GPS(sreader, fix_cb=callback)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'AS_GPS'
>>> gc.mem_free()
2531776
>>>
(sysname='LoPy', nodename='LoPy', release='1.20.1.r2', version='v1.11-06dfad0 on 2019-11-30', machine='LoPy with ESP32', lorawan='1.0.2', pybytes='1.3.0')
For a project for motorcyclists I need current GPS data.
First step is to determine and record data for the simulation during the ride.
I found the wonderful libraries of Peter Hinch. Isn't he also a motorcyclist?
I use
uasyncio in the fast_io version
as_GPS
os.listdir("as_GPS")
>['as_GPS.py', 'as_GPS_utils.py', 'as_rwGPS.py']
>
>asyncio works in simple tests.
>
>But as_GPS does not want to instantiate:
gps = as_GPS.AS_GPS(sreader, fix_cb=callback) # Instantiate GPS
AttributeError: 'module' object has no attribute 'AS_GPS'
>I can't find any typos.
>No difference when using the original uasyncio version
I posted this topic at Pycom-forum some days ago.
My hope is, that Peter Hinch will read this topic here.
Same Problem on other hardware (FiPy)
precompiling to -.mpy-files made no difference
Thank you for help...
>(DeepL helped me to translate)
>
>
>(2020, 1, 4, 11, 6, 55, 480879, None)
>Pycom MicroPython 1.20.1.r2 [v1.11-06dfad0] on 2019-11-30; LoPy with ESP32
>Pybytes Version: 1.3.0
>Type "help()" for more information.
import uasyncio as asyncio
import as_GPS
from machine import UART
uart= UART(1, baudrate=9600, pins=('P20','P21'))
sreader = asyncio.StreamReader(uart) # Create a StreamReader
gps = as_GPS.AS_GPS(sreader, fix_cb=callback) # Instantiate GPS
>Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
>AttributeError: 'module' object has no attribute 'AS_GPS'
i don think, it is not a memory problem:
see this test on FiPy
Pycom MicroPython 1.20.1.r2 [v1.11-06dfad0] on 2019-11-30; FiPy with ESP32
Pybytes Version: 1.3.0
Type "help()" for more information.
>>> import gc
>>> gc.mem_free()
2549728
>>> import uasyncio as asyncio
>>> gc.mem_free()
2533104
>>> import as_GPS
>>> gc.mem_free()
2532832
>>> uart= UART(1, baudrate=9600, pins=('P20','P21'))
>>> gc.mem_free()
2532480
>>> sreader = asyncio.StreamReader(uart)
>>> gc.mem_free()
2532256
>>> gps = as_GPS.AS_GPS(sreader, fix_cb=callback)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'AS_GPS'
>>> gc.mem_free()
2531776
>>>