usocket and uselect reboots board

Discussion related to "under the hood" OpenMV topics.
zeb
Posts: 3
Joined: Fri Apr 12, 2019 3:17 am

usocket and uselect reboots board

Postby zeb » Fri Apr 12, 2019 3:37 am

Hi guys

Im doing a project where im using tcp sockets on the openMV - that actually works quite well but the usocket.recv() is a blocking operation.
Following general suggestions online in how to do non blocking tcp in python i found the "select" session - and found the uselect library in openMVs micropython - i was happy! but!

Everytime i do anything regarding uselect and usockets the openmv board simply reboots ... doesnt even matter HOW simple a piece of code i write :( is this a known bug/thing?
Or am i missing something?

Like even doing a poll with socketEvent = poller.poll(100) resets the board - no matter the length of the timeout
User avatar
iabdalkader
Posts: 732
Joined: Sun May 24, 2015 3:53 pm

Re: usocket and uselect reboots board

Postby iabdalkader » Fri Apr 12, 2019 8:49 am

Can you post a test script ? We can debug and fix it then.
zeb
Posts: 3
Joined: Fri Apr 12, 2019 3:17 am

Re: usocket and uselect reboots board

Postby zeb » Mon Apr 15, 2019 5:12 am

hmm, doesnt seem im allowed to write the script here - i tried commenting with it - but i keep getting an error about "/posting.php"
But anyways - the code ive attached is just a test script that connects to a wifi then to a tcp server (i wrote one in nodejs - but any tcp server should do)
as soon as the line

Code: Select all

fdVsEvents = pollObj.poll(1000)
is run - the board reboots - ive tried this with two separate openMV boards both running firmware 3.2.0

hope it helps ;)
Attachments
tcp-select-test-forum.py
(938 Bytes) Downloaded 2 times
zeb
Posts: 3
Joined: Fri Apr 12, 2019 3:17 am

Re: usocket and uselect reboots board

Postby zeb » Mon Apr 15, 2019 5:13 am

I should probably note that any function in the uselect library ive tried reboot the board -

Code: Select all

uselect.select 
for instance also reboots
User avatar
iabdalkader
Posts: 732
Joined: Sun May 24, 2015 3:53 pm

Re: usocket and uselect reboots board

Postby iabdalkader » Mon Apr 15, 2019 3:32 pm

Okay I see the problem, actually we don't implement select/poll in the WINC1500 driver. The ioctl function is not even set (it shouldn't crash the cam however, I'll debug this). You can't use this module for now, but you can use the set timeout function to zero instead to set the socket to non-blocking (it's basically the same effect).

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 6 guests