• LoPy - getting datetime after power interrupt

    lopy gps lora
    3
    0 Votes
    3 Posts
    1k Views
    T
    @robmarkcole choices I see other than from GPS are use a real battery backed up RTC (maybe via i2c https://www.sparkfun.com/products/12708). get the time from network on startup. obviously NTP works with Cat-M1 and Wifi if you have an internet connection. It appears you could send date/time via downlink on sigfox, but due to rate limitations you would probably need to explicitly request time on boot. Lorawan - you would need to provide a time service. It doesn't appear to be in the protocol spec, and traversal time would mean time is a bit wrong if you hop through nodes. Option 1 would probably be the best option in my opinion. Works without a network if datetime/set correctly initially.
  • Default startup AP credentials

    wifi access point
    3
    0 Votes
    3 Posts
    478 Views
    R
    @malachib As @reidfo wrote, inspect your boot.py file and all .py files involved in your running project (main.py, etc.). You can also check as below: import pycom pycom.wifi_on_boot() pycom.wifi_ssid() pycom.wifi_pwd()
  • AS923 Class C not working?

    lora lopy lorawan asia class c
    9
    0 Votes
    9 Posts
    2k Views
    H
    @oligauc Can you tell what is wrong with this code then: from network import LoRa import socket import binascii import settings import sys import time import pycom LORA_FREQUENCY = 923000000 LORA_FREQ_ADD = 20000 LORA_GW_DR = "SF10BW125" LORA_NODE_DR = 2 # initialize LoRa in LORAWAN mode. # Please pick the region that matches where you are using the device: # Asia = LoRa.AS923 # Australia = LoRa.AU915 # Europe = LoRa.EU868 # United States = LoRa.US915 lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.AS923, device_class=LoRa.CLASS_C) # create an OTA authentication params dev_eui = binascii.unhexlify('70b3d5499da97f9c') app_eui = binascii.unhexlify('ADA4DAE3AC12676B') app_key = binascii.unhexlify('11B0282A189B75B0B4D2D8C7FA38548B') # set the 3 default channels to the same frequency (must be before sending the OTAA join request) print('Adding channels') lora.add_channel(0, frequency=923200000, dr_min=0, dr_max=5) #join a network using OTAA print('Joining...') lora.join(activation=LoRa.OTAA, auth=(dev_eui, app_eui, app_key), timeout=0, dr=LORA_NODE_DR) #lora.join(activation=LoRa.OTAA, auth=(dev_eui, app_eui, app_key), timeout=0) # wait until the module has joined the network while not lora.has_joined(): time.sleep(2.5) print('Not joined yet...') print('Joined') # remove all the non-default channels print('Removing other channels') for i in range(1, 16): lora.remove_channel(i) # create a LoRa socket s = socket.socket(socket.AF_LORA, socket.SOCK_RAW) # set the LoRaWAN data rate s.setsockopt(socket.SOL_LORA, socket.SO_DR, LORA_NODE_DR) #test set unconfirmed. s.setsockopt(socket.SOL_LORA, socket.SO_CONFIRMED, 0) # make the socket blocking s.setblocking(False) time.sleep(5.0) pkt = b'PKT #' + bytes([i]) print('Sending:', pkt) s.send(pkt) time.sleep(4) print('Listening...') while True: rx, port = s.recvfrom(256) if rx: print('Received: {}, on port: {}'.format(rx, port)) time.sleep(1)
  • Failed to upload 22k file over FTP

    ftp upload failure
    4
    0 Votes
    4 Posts
    616 Views
    T
    I found, that the problem only exist, while the Lopy is in time.sleep(). Can someone confirm this? Cheers, Thomas
  • Getting Started with GPS

    pytrack gps lopy4
    2
    0 Votes
    2 Posts
    712 Views
    danD
    @dfcarpenter could you try leaving the Pytrack for ~30 mins outside, to pick-up the satellites data, as this is a cold-start, could take a while. Also check with a mobile app how many satellites are visible on your exact position, it could be a glitch. You could try alternative GPS libraries like micropyGPS or this alternative L76GNSS module.
  • Access downlink header data

    uplink message headers
    2
    0 Votes
    2 Posts
    391 Views
    danD
    @rvandam You can get the timestamp of the last received LoRa packet with lora.stats() (docs), if that helps.
  • How Decrypt LoRa data

    lopy micropython decrypt
    4
    0 Votes
    4 Posts
    3k Views
    M
    @rcolistete Thank you for your time and explanation
  • Low Power operations

    lopy deepsleep low power lora
    6
    0 Votes
    6 Posts
    2k Views
    danD
    @tobz as @rcolistete said, it's available in the current stable firmware as well, 1.18.1.r1 (docs)
  • Lopy4 how to update .bin files to device?

    lopy4 firmware
    2
    0 Votes
    2 Posts
    442 Views
    robert-hhR
    @rossdem699 You can use the pycom updater. Start the Pycom updater and tell it to update from a file. When it asks for a file, give it the name of the zip file. The updater will unpack the file itself. Generally you may also use ftp OTA update. Take the appimg.bin file from the package and transfer it to flash/sys. Once that is finished, reboot the device. But for a large change like 1.18.1r1 to 1.19.0.b4 and its possible change in the flash layout this may not work.
  • LoRa encoding/decoding

    kpn lora encoding decode
    9
    0 Votes
    9 Posts
    2k Views
    V
    My apologies for the late response and any confusion I might have caused by switching to integers within the post. The big/little-endian format was indeed the issue. Adding a '>' sign in both the micropython and the php script solved the problem. This is what I ended up doing. Micropython encoding # Pack data data = struct.pack('>5i', 25, 36, 81, 11) # Send data print('Sending data') lora.join(activation=LoRa.ABP, auth=(dev_addr, nwk_swkey, app_swkey)) s = socket.socket(socket.AF_LORA, socket.SOCK_RAW) s.setsockopt(socket.SOL_LORA, socket.SO_DR, 5) s.setblocking(True) s.send(bytes(data)) s.setblocking(False) PHP decoding $struct = new Struct(); $decoded_payload = $struct->unpack('>5i', hex2bin($decrypted_payload)); $data = [ 'var1' => $decoded_payload[0]/10, 'var2' => $decoded_payload[1]/10, 'var3' => $decoded_payload[2]/10, 'var4' => $decoded_payload[3]/10, 'var5' => $decoded_payload[4]/10 ]; The PHP struct class I used in the PHP decoding script can be found here. Thanks a lot for your help!
  • View files created on flash

    lopy flash
    2
    0 Votes
    2 Posts
    573 Views
    robert-hhR
    @oved-yavine you can connect by ftp using tools like filezilla for plain ftp you can use "import uos;uos.listdir()" to get a list of files there is a useful python script called upysh.py which offers a small set of shell like commands at the REPL prompt. Import it with "from upysh import *", and then you have commands like ls, cat, .. (https://github.com/micropython/micropython-lib/tree/master/upysh)
  • Connect ePaper Display to TTN

    lora epaper eink ttn lopy
    7
    0 Votes
    7 Posts
    2k Views
    rcolisteteR
    There are MicroPython drivers for epaper displays. E. g. : ayoy/micropython-waveshare-epd, supports 1.54" Waveshare two-color E-Paper Display only : https://github.com/ayoy/micropython-waveshare-epd mcauser/micropython-waveshare-epaper, for many display sizes : https://github.com/mcauser/micropython-waveshare-epaper https://forum.micropython.org/viewtopic.php?f=14&t=3393
  • Where can I download a working tsl2591 library?

    tsl2591 library
    3
    0 Votes
    3 Posts
    511 Views
    E
    @jimmie In the thread you link to your post the authors use SPI for SSD1306 LCD, if you need code to use your LCD via IIC here you can found informations https://forum.pycom.io/topic/3900/object-with-buffer-protocol-required I sugest you to explain if the both component are on the same IIC bus pin or not, and if you have already selected a tsl2591 python library to use with your project. After these two step done we can help you to modify one or both library to work on the same i2c instance. (if you have different i2c bus it's very simple).
  • 0 Votes
    2 Posts
    406 Views
    J
    @suad_m5 As a LoPy (and hence a nano gateway) can only listen on one channel at a time, it is not LoRaWAN compliant, and only devices that are configured to use that single channel will be supported. It is not a generic gateway, it's just a tool to make quick tests without a real gateway around. This does not mean only LoPys can be used. If you can configure your device to only use the channel you configured on your nano gateway, it should work. This is however not possible on many devices.
  • Loppy integration with LG01-P LoRa Gateway

    lora lora gateway
    4
    0 Votes
    4 Posts
    1k Views
    J
    @modialiasger For anyone to be able to help you, you'll have to provide a lot more details: what version of the firmware are your running? do you have an antenna hooked up to the LoPy? Is is connected to the right port? what code are you using to connect? what is the configuration of your gateway? is the device correctly recorded in the TTN backend? are you performing an OTAA or an ABP join? what happens? Do you have any errors? If so, which? is there anything showing up in the gateway's or TTN logs? If so, what?
  • no execution after lora thread

    lora mqtt threading
    5
    0 Votes
    5 Posts
    846 Views
    C
    @robert-hh Hello there Robert. Thanks for the reply. Both of my threads have 60 sec sleeps inside. The lora thread have other sleeps as well.
  • Problems getting L01 into bootloader mode

    l01 bootloader
    6
    0 Votes
    6 Posts
    862 Views
    D
    @thosch42 Well, you learned the hard way. It happens all the time, at least for me :)
  • L01 does not run boot.py or main.py

    l01 boot.py main.py
    2
    0 Votes
    2 Posts
    518 Views
    T
    It's fixed!! See post Problems getting L01 into bootloader mode. Cheers, Thomas
  • Lopy4 433/868 , use of antennas at the same time.

    lopy4 antenna 433mhz 868mhz
    3
    0 Votes
    3 Posts
    554 Views
    J
    @josesebas1990 from what I understand you should be able to use both and alternate between them by software, but probably not use them at the same time (e.g. listen or receive on both antennas at the same time).
  • GPS libraries

    gps pytrack
    5
    0 Votes
    5 Posts
    693 Views
    M
    If you are unfamiliar with GPS (sounds like that) and curious what "almanac" and "epemeris data" means, have a look at the detailed (and quite interesting) GPS book: https://www.u-blox.com/sites/default/files/products/documents/GPS-Compendium_Book_(GPS-X-02007).pdf

Pycom on Twitter