Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    New Firmware Development release v1.19.0.b4

    Scheduled Pinned Locked Moved Beta Announcements & Development News
    firmwaredevelopment
    33 Posts 15 Posters 9.5k Views 15 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I Offline
      iwahdan
      last edited by iwahdan

      Hello everyone,

      Development firmware v1.19.0.b4 is now released. you can now download the firmware to pycom devices via the firmware updater or download the source from here.

      Important: This firmware has support for both FatFS and LittleFS and will default to using FatFS unless you set the correct File System when flashing the board. For this reason, you can only flash this firmware using the new beta firmware updater 1.15.2.b0 or by downloading the firmware file manually and flashing it via the local file option.

      For documentation you can find it here.

      Release Notes:

      Added Feautures:

      • Added RTC memory support

      • Added support for including uasyncio micropython module

      • Added Lora mesh functionality with openthread protocol

      Fixes:

      • Fixed problems with Non-Blocking Sockets

      For new Lora Mesh functionality we added example scripts that you can find here

      Wahdan

      H 1 Reply Last reply Reply Quote 2
      • S Offline
        Sympatron
        last edited by Sympatron

        Interesting additions!

        I have a few questions:

        • The RTC-memory documentation is missing how much data can be saved.

        • Is it a Full Thread Device or just an End Device?

        • I have no experience with OpenThread. Can a LoPy be used as a Border Router to transparently send UDP packets to non-Thread devices e.g. via WiFi? If not at the moment will it be in the future or can this be implemented by oneself? This would be extremely interesting for us, because it would spare us of having to implement something similar.

        I 1 Reply Last reply Reply Quote 0
        • catalinC Offline
          catalin
          last edited by catalin

          Regarding LoRa-Mesh (based on OpenThread) functionality a couple of docs:

          • https://docs.pycom.io/v/development_release/chapter/tutorials/lora/lora-mesh.html <later edit>
          • new Lora methods (.mesh() and .cli()), also the mesh sockets here: https://docs.pycom.io/v/development_release/chapter/firmwareapi/pycom/network/lora.html

          As usual, we need community feedback: what interesting things you want to do with a Lora-Mesh network?

          Catalin,

          Have you checked out our docs for the answer? (Now with an easy search function) https://docs.pycom.io
          Check out our newly revamped device management platform, Pybytes! https://pybytes.pycom.io/

          1 Reply Last reply Reply Quote 1
          • S Offline
            Sympatron
            last edited by

            As others have mentioned in the past it would be extremely helpful to have some kind of roadmap. I don't necessarily need fixed dates, but we are trying to use your device commercially and therefore we need to make business decisions.

            If we had known you were working on an OpenThread implementation we could have saved a lot of time developing our own LoRa network protocol.

            1 Reply Last reply Reply Quote 0
            • I Offline
              iwahdan @Sympatron
              last edited by

              @sympatron , You can save up to 2KB of data in RTC memory

              Wahdan

              G 1 Reply Last reply Reply Quote 2
              • G Offline
                gregcope @iwahdan
                last edited by

                @iwahdan

                Hi. Any docs for this (rtc memory)

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  Sympatron @gregcope
                  last edited by

                  @gregcope https://docs.pycom.io/v/d0d9191ca2df10c6ca280de6fd2f11e7c5a18e6f/chapter/firmwareapi/pycom/machine/RTC.html#rtcmemorydata

                  G 1 Reply Last reply Reply Quote 0
                  • catalinC Offline
                    catalin
                    last edited by catalin

                    hi @Sympatron, I can answer the Openthread questions:

                    • in this release openthread is compiled for FTD( though, no DNS, Commissioner/Joiner role, DTLS, Jam detection, here are include files)
                      • you can (or I can provide) a MTD openthread library build, code is open-source at https://github.com/pycom/pycom-esp-idf/tree/idf_dev
                    • I've been investigating the Border Router issue:
                      • for the moment the UDP packets are not transferred to Wifi
                      • Solution A: (doable by you immediately in a micropy script) you could start and UDP server (bind a socket) on the designated Border Router device, propagate it's IPv6 (RLOC or ML_EID) thru multicast in the whole network, receive all UDP packages and manually take UDP payload to the Wifi socket
                      • Solution B: you can also use lora.cli('prefix add xx::xx') to insert the prefix for out-mesh traffic, then use otIp6ReceiveCallback to filter on Border Router all the IP traffic having that prefix, unpack UDP packets, repack and send on wifi socket; basically some NAT64 needs to be implemented
                      • I would try the solution B, but not sure if we can release sooner than 1 month
                      • for implementing Solution A, take a look here for UDP sockets example: https://github.com/pycom/pycom-libraries/tree/master/lib/lora_mesh

                    Catalin,

                    Have you checked out our docs for the answer? (Now with an easy search function) https://docs.pycom.io
                    Check out our newly revamped device management platform, Pybytes! https://pybytes.pycom.io/

                    1 Reply Last reply Reply Quote 1
                    • G Offline
                      gregcope @Sympatron
                      last edited by

                      @sympatron thanks!

                      1 Reply Last reply Reply Quote 0
                      • H Offline
                        Harish kumar @iwahdan
                        last edited by Harish kumar

                        Hi @iwahdan ! I am using Arduino as a device. And lopy4 as a repeater, where lopy4 has to fetch data from the device and it needs to send to the Gateway(only by lorawan). Is it possible with this ?
                        I am sending OTAA from Arduino to server.
                        Thank you in Advance !

                        I 1 Reply Last reply Reply Quote 0
                        • R Offline
                          RodgerG
                          last edited by

                          Hi @catalin

                          This LoRaMesh is great and just what I have been looking for!

                          I tried downloading the example file and library and loaded them on to a LoPy4 on a PySense.

                          However, I get a strange error on start up (or reset) as below...

                          Initializing filesystem as LittleFS!
                          LoRa MAC: 70b3d5499625b58c
                          Traceback (most recent call last):
                            File "main.py", line 23, in <module>
                            File "/flash/lib/loramesh.py", line 98, in led_state
                          OSError: the requested operation is not possible
                          Pycom MicroPython 1.19.0.b4 [v1.9.4-50f84dd] on 2018-07-13; LoPy4 with ESP32
                          >>> mesh.led_state()
                          >>>
                          

                          The call from main.py is as follows

                          while True:
                              mesh.led_state()
                          

                          and the code on line 98 of loramesh.py is the third line of the following method

                              def led_state(self):
                                  """ Sets the LED according to the Thread role """
                                  pycom.rgbled(self.RGBLED[self.state()])
                          

                          When I just call mesh.led_state() from the command line, there is no such error, as you can see from the console log.

                          I tried putting mesh.led_state() in a try-except clause, but still kept getting the same OS error.

                          As a workaround, I have copied RGBLED to main, and replaced

                          mesh.led_state()
                          

                          with

                          pycom.rgbled(RGBLED[mesh.state()])
                          

                          and this works.

                          I cannot see any obviouse reason for the error.

                          1 Reply Last reply Reply Quote 0
                          • R Offline
                            RodgerG
                            last edited by

                            @ catalin

                            Found the problem

                            The example code was missing

                            # Make sure heartbeat is disabled before setting RGB LED
                            pycom.heartbeat(False)```
                            E 1 Reply Last reply Reply Quote 0
                            • I Offline
                              iwahdan @Harish kumar
                              last edited by

                              @harish-kumar yes it is possible, however you have to make sure that Arduino only use a single frequency, as Pycom devices can only listen on a single frequency, you should be implementing something like that
                              https://docs.pycom.io/chapter/tutorials/lora/lorawan-nano-gateway.html#otaa-over-the-air-activation
                              on Arduino.

                              Wahdan

                              1 Reply Last reply Reply Quote 0
                              • E Offline
                                egimbernat @RodgerG
                                last edited by

                                @rodgerg When pycom.heartbeat is set to true (By default it is), creates a lock around led operations that's because the OSError. Even if you adquire a lock and iterate around led operations on main thread or an volatile thread pycom.heartbeat will have priority when turned on.

                                The solution as you found is to set:

                                pycom.heartbeat(False)
                                

                                When you want to gain control over led, sometimes you may need a very small delay in order the heartbeat lock to release. For example:

                                pycom.heartbeat(False) #Assuming that it was True
                                time.delay(0.05)
                                mesh.led_state()
                                
                                1 Reply Last reply Reply Quote 1
                                • C Offline
                                  cmisztur
                                  last edited by cmisztur

                                  @iwahdan Thanks. Should importing uasyncio work in this release ?

                                  I 1 Reply Last reply Reply Quote 0
                                  • I Offline
                                    iwahdan @cmisztur
                                    last edited by iwahdan

                                    @cmisztur, We've done some updates in this Dev release to support including the uasyncio lib from micropython.

                                    The uasyncio library is provided by MicroPython under micropython-lib: https://github.com/micropython/micropython-lib/tree/master/uasyncio
                                    Unlike CPython's asyncio library it is splitted into several parts:

                                    • uasyncio.core
                                    • uasyncio.queues
                                    • uasyncio.synchro
                                    • uasyncio.udp
                                    • uasyncio.websocket.server

                                    The uasyncio library relies on the micropython-lib/collections (defaultdict, deque) and logging libraries.

                                    Note: I've updated my Release post as it was wrongly implying that the uasyncio already included in firmware

                                    Wahdan

                                    S 1 Reply Last reply Reply Quote 1
                                    • S Offline
                                      soulsurfer @iwahdan
                                      last edited by

                                      @iwahdan - Given the recent change in wording (and the fact that I'm a micropython noob!) are there explicit instructions anywhere on precisely how to "includ[e] uasyncio micropython module[s]" plus the required libraries?

                                      I C 2 Replies Last reply Reply Quote 0
                                      • I Offline
                                        iwahdan @soulsurfer
                                        last edited by

                                        @soulsurfer, using FTP or pymkr you can upload the uasyncio modules to your Pycom device with the following hierarchy :

                                        • uasyncio sub-modules into /flash/lib/uasyncio
                                        • websocket.server sub-module under: /flash/lib/uasyncio/websocket
                                        • collections sub-modules into /flash/lib/collections
                                        • logging sub-module into /flash/lib

                                        And then you can import uasyncio library into your script and start using it

                                        Wahdan

                                        S S 2 Replies Last reply Reply Quote 1
                                        • S Offline
                                          Sympatron @iwahdan
                                          last edited by

                                          @iwahdan I think it would be nice to have this as frozen modules by default in the future.

                                          1 Reply Last reply Reply Quote 0
                                          • C Offline
                                            cmisztur @soulsurfer
                                            last edited by

                                            @soulsurfer here, I documented the process https://medium.com/@chrismisztur/pycom-uasyncio-installation-94931fc71283

                                            1 Reply Last reply Reply Quote 5

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post

                                            Pycom on Twitter

                                            Pycom