lora-mote-emulator icon indicating copy to clipboard operation
lora-mote-emulator copied to clipboard

Error while retrieving the device session

Open Gillani0 opened this issue 4 years ago • 5 comments

Hi,

I can send the Data Push join message and receive and parse its response correctly with correct mic. However, when it tries to save the session I get the following error:

ERROR - can't pickle memoryview objects

This is during self.save() operation.

Syed

Gillani0 avatar Apr 24 '20 12:04 Gillani0

Would you please show the whole error message or locate the exception position in code? I didn't encounter such an error. This may cost by a bug. I use memoryview in some process to save processing time, but when it comes to pickle (actually it shouldn't appear in pickle process), the memoryview object should be casted into bytes to be pickled.

houluy avatar Apr 25 '20 03:04 houluy

Hi following is the error trace

 - ERROR - can't pickle memoryview objects

Traceback (most recent call last):
  File "main.py", line 98, in main
    gateway.push(udp_client, phypld, mote)
  File "/lora-motes-emulator/motes/mac.py", line 304, in push
    self.parse_pullresp(pullresp[0], mote)
  File "/lora-motes-emulator/motes/mac.py", line 372, in parse_pullresp
    self.parse_txpk(txpk, mote)
  File "/lora-motes-emulator/motes/mac.py", line 416, in parse_txpk
    mote.parse_phypld(phypld)
  File "/lora-motes-emulator/motes/mac.py", line 1189, in parse_phypld
    self.parse_joinacpt(mhdr, macpld, mic)
  File "/lora-motes-emulator/motes/mac.py", line 1125, in parse_joinacpt
    self._initialize_session(optneg)
  File "/lora-motes-emulator/motes/mac.py", line 490, in _initialize_session
    self.save()
  File "/lora-motes-emulator/motes/mac.py", line 535, in save ```

Gillani0 avatar Apr 29 '20 04:04 Gillani0

The bug has been fixed.

houluy avatar May 16 '20 08:05 houluy

Thanks @houluy it seems to be fixed.

However, I've found other issues in your documentations and Join algorithm. Do you mind if I send a pull request? Cheers

Gillani0 avatar May 20 '20 11:05 Gillani0

@Gillani0 Please ~ I'm very appreciated! :)

houluy avatar May 20 '20 13:05 houluy