The ticks_xx functions wrap around at a certain value. For the initial micropython, this values is 2^30-1 (MP short int). For the pycom port, it is 2^32-1. Thats done by simply using C 32 bit integers. This implementation has two drawbacks:
uasyncio expects timers to be MP short ints.
using 32 bit ints cause the values to be standard ints in Python, which are more time-consuming to deal with. That may hurt if for instance ticks_diff and ticks_xx are used a tight timing loop.
So the question is, should we go again to the 2^30-1 wrap-around period. It is not difficult. The code is still there and just has to be enabled by a config flag, and then unused code can be deleted. Only ticks_cpu requires special care, since different from the mp.org version is counts us ticks and the timing call is also used by the SX1272 and SX1276 driver. But besides that, I see nothing to consider.
@catalin I created a PR to allow binding to an address in order to support sending from a specific address. Please see https://github.com/pycom/pycom-micropython-sigfox/pull/234
I was looking into adding support for multiple sockets, but I haven't come up with a clean way to do that yet. My best guess at it would require a packet queue per socket and I don't really want to do that without variable-length messages in the queue and that would involve mutexes and some error-prone code. That may still be a reasonable thing to do, but looks like it is more than an evening's effort.
@kjm This is a recurring discussion in Micropython. See also for instance:
But still, the number which the raspi (C-Python) displays is not the number internally stored. However, using a 64 bit float representation, the error is way smaller.
Note also, that rounding was improved in the micrpython.org branch:
For the esp8266 build, I get:
MicroPython v1.9.4-704-g62b4bebf-dirty on 2018-12-04; ESP module with ESP8266
Type "help()" for more information.
>>> round(691.59, 1)
But not so for the ESP32 build. The loboris branch again delivers 691.6
But, so sum up: it is not the rounding, that "fails", it's the display of decimal fractions.
If you just enter 691.6, REPL will show 691.5999. Similar with other numbers, but not every number.
@nagesh-divatagi please provide more details, including at least the hardware (modules, antennas) and firmware used, the relevant parts of your code on both sides, the distance, whether you’re indoors or outdoors, and what you actually get (logs, stats...).
@robert-hh This is not working well. During make skdconfig.h is replaced by make GENCONFIG (that is using wifi/scan/sdkconfig). The best is to modify that config.
However moving the freq from 160 to 80 -> it saves only 7mA ... I expected to be more.
So LoPY+shield with Wifi disable is consuming 35mA.
I am able to do an OTA update, i.e. changing from green to blue light as in the script/guide previously linked. However, its when I add the firmware.bin files to the directory I get errors, like the one shown in the post before this one.
@robert-hh Hi again, I got it working. I did a silly mistake...
Frist I downloaded the firmware from here (LoPy): https://software.pycom.io/downloads/LoPy.html
But of course I should have downloaded from here (LoPy4): https://software.pycom.io/downloads/LoPy4.html
Sorry for wasting your time, @robert-hh
@shariq Obviously you can set up your own ntp server, if you like, which is called instead of the ntp server pool on the internet. if you get the date & time from a different source, like an external rtc, you can use rtc.init() to set the local date & time.
You probably won't have to update the bootloader, unless there's some bug or the OTA mechanism changes. We have no features planned for the bootloader at the moment, so you should be fine with OTA updates.
Hi @bigboy20769 and @serafimsaudade,
It has indeed been changed. Just to note that you're using development firmware while the documentation is based on the stable version. If you check the dev documentation, you can find the changed method. Once the dev firmware has been released, the main documentation will be updated as well.