I am using MicroPython on PyCom module LoPy4, and in-house compile;
Pycom MicroPython 1.18.2.r7 [df9f237-dirty] on 2019-06-13; LoPy4 with ESP32
I am not a Python programmer, but very experienced in many other languages, so even if my Python questions look stupid, please don't treat me like an idiot.
I have encountered a strange situation that happens "sometimes" and the frequency of it occurring seems to be LoPy unit dependent, i.e. some of those I have do it much more commonly and others not at all.
Code: Select all
received_packet = self.lora_sock.recv(512)
if isinstance( received_packet, bytes ) :
packet_length = len(received_packet)
Code: Select all
TypeError: object of type 'function' has no len()
And yes, I am not dreaming this. The program is quite short, output goes to serial port and that is captured to log file on a Raspberry Pi "as-is", and the whole stacktrace in it and the line number matches the source code.
Any help is greatly appreciated.
// Niclas