OSError: -32512 when I try
>>sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) >>sock.settimeout(5) >>s = ssl.wrap_socket(sock) OSError: -32512
@Knoahlr, thanks a lot for the feedback. Keep me posted in case of any change.
@abilio gc.collect() seems to have solved the problem. Had it up and running smoothly for about 30mins now.
before every ssl connection gc.mem_free() is about 37000 -39000. Before it would fall all the way to 600.
@abilio I was almost certain that was the case. Ive introduced gc.collect() in my loops and I think this will solve the problem.
If not, I`ll be back here for some more help
Im using a HC-SR04 Ultrasonic sensor to send distance measurements to my company`s IOT server. Sending this data requires an ssl connection.
Every time I send this data I have to create a time.ticks_us() object and set up a pin callback among other things.
@Knoahlr, this error used to appear very often in previous versions. It is caused when the OS (not the GC) runs out of memory. We released some memory in version 1.5.0, and the problem seemed to disappear. Perhaps the frequency of SSL connections you're making, combined to other things you're using are creating this out of memory condition. Can you provide more information about your specific application? perhaps some code example?
@abilio 184.108.40.206.b2, this doesn`t happen all the time. Actually, it rarely happens. But my application requires SSL socket connections to be made every second and sometimes after running for a while the error is thrown.
Which firmware version are you using?