OpenMV Cam RT1062 RSTP Streamer code not connecting - What am I doing wrong?

I have been trying for quite a few days to make the sample rstp_video_server_wlan code work on my Cam RT1062 unsuccessfully. I can make the code for the mjpeg streamer code work, so it would appear the wireless network hardware is fine. Other appliances can connect to my home network from the same spot, so I can also consider that to not be an issue.

I have read a lot about the topic in different forums/websites; I can recall some comment about there being an issue with the Micropython code as well? If that is the case, is there a workaround?

If that is not the case, is there a bug in the firmware/sample? Please advise.

Thanks and regards,

Ernesto.

The example for this works fine. Where does the script get stuck? We’ve spent a lot of time debugging it and it should just work.

What app are you connecting with? VLC or FFMPEG built-in to OpenMV IDE?

Also, do you know how to use wireshark? It would help to see the packet transactions between the two devices.

…

E.g. once the camera connects to the internet, does it print its IP address? And does it say play when you connect? But, no video?

Ii just gets stuck trying to connect:

Trying to connect. Note this may take a while…

So I can’t even get an IP address, or connect to it from any app.

I do use wireshark, but not sure what to do to monitor it trying to connect.

I modified the code to see if it was getting stuck doing something else (and basedf on what I read, tried to force it to use WPA2_PSK but your sample does not seem to require it.

Also tried to force it to use a static IP address. Neither DHCP or static IP work.

Setup Network Interface

network_if = network.WLAN(network.STA_IF)
network_if.active(True)
network_if.config(security=3) #WLAN.WPA2_PSK

wlan_mac = network_if.config(‘mac’)
security = network_if.config(‘security’)

print(‘MAC Address: {:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}’.format(wlan_mac[0],wlan_mac[1],wlan_mac[2],wlan_mac[3],wlan_mac[4],wlan_mac[5]))
print("Security: ", security ) # Show MAC for peering

if not network_if.isconnected():
print(‘Connecting to network…’)
network_if.ifconfig((‘192.168.1.71’, ‘255.255.255.0’, ‘192.168.1.250’,‘8.8.8.8’ ))
network_if.connect(‘XXXXX’,‘XXXXX’)
while not network_if.isconnected():
print(‘.’, end=‘\n’)
blue_led.on()
time.sleep(1)
blue_led.off()
red_led.on()
time.sleep(1)
red_led.off()
print(network_if.isconnected())
print(network_if.status())
print()
print(‘Connected:’, network_if.isconnected())
else:
print(‘Already connected!’)

I can see the LED changing from red to blue so it is in that loop, but no connection whatsoever.

Regards,

Ernesto

Hi, this is then an issue with connecting to the WiFi network and not the protocol handling code.

We’ve had a few people comment about WiFi setup issues ont he forums recently. They resolved it via router configs.

I tried changing this in my router and did not work - this router only offers a couple of options. I even disabled security and it did not work. I will try to use a different access point and see if there is any difference. I have also tried using 2.4Ghz and 5Ghz networks with no difference.

I also tried adding this line of code:
if not network_if.isconnected():
print(‘Connecting to network…’)
network_if.ifconfig((‘dhcp’)). <=======

And I got a different outcome:
Traceback (most recent call last):
File “”, line 73, in
OSError: timeout waiting for DHCP to get IP address

Could the unit be faulty?

No, highly unlikely.

I can make the code for the mjpeg streamer code work, so it would appear the wireless network hardware is fine.

If this works then there should be no problem connecting to your wlan. The same setup routine is used for each.

Can you post the working script and failing script? Please use the code </> entry button for the forums.

The code that works is the one for mjpeg_streamer_ap in the examples. Anything that sets up an access point, as opposed to connecting to an existing WiFi network, works. Once the AP is running, I can connect to it from my iPhone by first connecting to the AP and then pointing my iPhone browser to 192.168.4.1:8080. I can see the video from the camera.

I just tested it with the latest firmware on my RT1062.

It’s most likely your WiFi setup. For me, note that the SSID is case sensitive. I often type it in and capitalize one of the letters, which makes it take forever.

The connect.py example should run with the right WiFi network SSID and password.

I have an Eero6 pro wifi mesh network at home. It’s working via 2.4GHz WPA2.

… I’m not sure how to exactly help you more… I have 5 access points via the Eero6 pro and it works… so, I’m not on an old network with out of date stuff and etc. Meaning, the system definitely works with new wifi hardware.

1 Like

Noted. I will try with other network hardware at a later time as it is all in boxes due to moving house soon. Thanks for the assistance.