houluy / lora-mote-emulator

This is a device (mote) emulator for LoRaWAN protocol(1.0 & 1.1). Completely realized by Python 3.6
MIT License
22 stars 12 forks source link

ERROR - [Errno 22] Invalid argument while wotking with LoRiot (mac version 1.0.3) #14

Open t0mer opened 1 year ago

t0mer commented 1 year ago

Hi, I'm trying to run mote with LoRiot server and I'm getting the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/src/__main__.py", line 113, in main
    gateway.push(udp_client, phypld, mote)
  File "/usr/local/lib/python3.8/site-packages/src/mac.py", line 296, in push
    transmitter.send(self.form_pshdat(data, mote))
  File "/usr/local/lib/python3.8/site-packages/src/network.py", line 17, in send
    self.s.sendto(data, self.target)
OSError: [Errno 22] Invalid argument

Thanks

houluy commented 1 year ago

Hi, please tell us how is this error got? Which command are you running?

t0mer commented 1 year ago

Hi, I have updated the device.json, config.json and gateway.json(Attached) Then I ran the following command: mote join -n Then I got the following response:

Forming a join request message - NwkKey: e8f2e241a6496f4699bbf876ee70aaaa, AppKey: e8f2e241a6496f4699bbf876ee70aaaa, AppEUI: , DevEUI: 4491600000f7aaaa, DevNonce: 10, MIC: f844d810,Final Join Req: 000000000000000000aaaaf700006091440a00f844d810 --

Followed by: 2023-01-01 14:35:39,683 - INFO - Sending a PUSH DATA - Verson: 02, Token: a2b2, Identifier: 00, GatewayEUI: 4e7b27ffffbfd427

Followed by: b'\x02\xa2\xb2\x00N{\'\xff\xff\xbf\xd4\'{"rxpk": [{"tmst": 1672583739, "chan": 1, "rfch": 1, "freq": 868.3, "stat": 1, "modu": "LORA", "datr": "SF7BW125", "codr": "4/5", "lsnr": 2, "rssi": -119, "size": 32, "data": "AAAAAAAAAAAAqqr3AABgkUQKAPhE2BA="}], "stat": {"time": "2023-01-01 14:35:39 GMT", "lati": 39.9075, "long": 116.38806, "rxnb": 1, "rxok": 0, "rxfw": 0, "ackr": 0, "dwnb": 0, "txnb": 0}}'

and in the end: 2023-01-01 14:35:39,698 - ERROR - [Errno 22] Invalid argument

Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/src/main.py", line 113, in main gateway.push(udp_client, phypld, mote) File "/usr/local/lib/python3.8/site-packages/src/mac.py", line 296, in push transmitter.send(self.form_pshdat(data, mote)) File "/usr/local/lib/python3.8/site-packages/src/network.py", line 17, in send self.s.sendto(data, self.target) OSError: [Errno 22] Invalid argument

Thanks (:

config.txt device.txt gateway.txt

t0mer commented 1 year ago

Hi @houluy, Did you have the chance to take a look?

Cheers (: