• LoRa encoding/decoding

    LoPy 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!
  • Trying to connect to LTE-M1

    FiPy lte-m kpn not attaching
    17
    0 Votes
    17 Posts
    4k Views
    E
    Entlich mal. I've got connection. Got finally a new SIM from KPN and it worked immediately . Thanks all for the encouraging words:-) Now I can start my project. Keep you posted.
  • 0 Votes
    13 Posts
    3k Views
    F
    @pmb_nl Yes it works without any problems the last few weeks so far
  • 0 Votes
    3 Posts
    1k Views
    RobTuDelftR
    Question 1: that is correct, the payload is still encrypted. Question 2: this has been discussed before here. I would like to refer you to Pierre's blog here.
  • LoRaWAN with LoPy and KPN + Loggly

    Projects kpn lopy loggly python
    2
    1
    1 Votes
    2 Posts
    2k Views
    RobTuDelftR
    Great Pierre, thank you. I've added the MySQL support, see the pull request.