Images over wifi with OpenMV and Nicla Vision (no usb cable)?

Hi there. Im new so please try to go slowly for me. I have successfully completed this tutorial, and Im scratching my head a little…(https://docs.arduino.cc/tutorials/nicla-vision/live-streaming/)

I can get to the point where the board is connected to wifi and streaming inages over the network… but its still connected by USB to OpenMV on my laptop. Is it reasonable to expect to be able to run the board with only a power source and no USB cable, and have it stream images back to OpenMV over wifi so I can use it in the physical application environment, and not just beside my laptop? Am I describing that using the right descriptors or are there a keywords that better describe what im trying to do?

I’m about to go looking for a long usb cable to help me get the images to develop my model i need while connected via usb. Can anyone steer me the right way.

As an aside. I’d be very interested in working with a mentor to accelerate my efforts here if anyone feels the have the experience and time. Would happily make a small payment or cash donation to the community if somone was willing to coach me a bit.

Thanks all!

Bmac

Hi BigMac1982,

I’m available for help and support. However, you’ll find ChatGPT able to provide some help with a lot of your questions. For general MicroPython specifics it should be very good.

Anyway, you just need to save the script to the camera via Tools->Save Script and then the camera will run that when it powers on which can be from a USB cable attached to a power bank.

Thanks Kwabena, appreciate that and yes, I will lean on ChatGPT as much as possible.

When connected via USB cable… my ability to connect to the wifi is inconsistent. When it does connect, more often than not I get stalled at a “Waiting for connection status” while my browser times out waiting for a response on :8080. It works maybe 10% of the time and I see the stream coming through. Typically, no amount of closing OpenMV, or restarting the board resolves this. Eventually, after full computer restarts, it may start streaming again. It’s a bit perplexing.

I’ve adjusted my router mode from WPA or WPA-2, to only WPA 2 as I read this could help… this doesn’t seem to help. Should I explore other security settings? Any other idea to increase reliability of connection?

Thanks for pointing me to the Tools → Save Script. I have run that, accepting “Strip comments and convert spaces to tabs?”. When I power the device from the wall, and do indeed see a conenction: it’s a single frame from the camera, which shows it has some kind of connection, but no more frames come through after that. It seems to stalls immediately.

I’m at a bit of a loss for how to trouble shoot this, and it has taken quite a bit of time trying to observe and confirm the behaviours I’m running into. This is my first project with the board. Should I persevere with this effort to get WIFI up and running, or focus on getting things done with a long (10m) USB cable? What would you recommend?

Thanks so much for your time!

@BigMac1982 - I’m not able to duplicate your issue. Do you have the latest firmware 4.6.20 installed on your Nicla? I just downloaded the example code, ran it on my nicla, opened it in google chrome, and I can stream video from the URL easily. I can also click stop on the webpage to stop the stream and refresh to restart it.

I was also able to save the script to the camera and restart streaming and etc. from it through the web browser without using the IDE to control the Python code.

It sounds like the internet connection is bad. You’ve got the antenna and everything connected to the Nicla right?

Ok thanks, good to know. Looking more closely at my Wifi, I can see that it’s operating on the 802.11ax protocol. I can see from one of your other posts that this could be the issue. I’m going to try that this evening and see how it goes.

Yes, I have the latest firmware installed. I’ve tweaked my router settings to only accept b/g/n on both 2.4 and 5G, and to use only WPA2, but I’m still seeing the same highly intermittent behavior.

Despite having successfully made those changes in the router, my computer is still reporting that the protocol it is using is WPA3 and AX (image below), but I’m suspecting that is just a function of the laptop hardware? Should I be persevering to update wifi hardware setting on my computer (it’s locked down by my work so I’ll need to get the IT guys to help. Is that work pursuing)? I’d think not as the computer is just a client of the wifi network and shouldn’t affect connectivity of the board alone to the Wifi.

Ultimately I’m stuck, and it seems the only option I have is to buy and test a second board, or commit to a wired w USB workflow, right? For some reason I suspect it’s a wifi configuration issue to make the board compatible with my wifi… but I’m not sure why, perhaps becuase it’s unusual to need to tinker like this just to get a connection. Is that what you’d recommend, buying another board?

I need to move on if I’m going to achieve my goals. Unfortunately I don’t have resources to readily spend buying another board, perhaps I can do that in the future. Please do share any advice that I can follow that can help me adjust that growing perception, as I’d love to fall in love with this thing, its just proving a challenge.

@BigMac1982 - Sorry about this issue. As far as I can tell the device is working correctly but just having an issue on your networks. There’s not much that can be done.

You could use Wireshark to look at packets being sent back and forth on the network. However, all MicroPython boards using the 1DX WiFi module will likely have the same problems on your network.

Ok. Appreciate the help. Ill move into other things.

Could you try the attached firmware? Let us know if it fixes the issue. Note this is a dev firmware you should not use it for anything else, also it may corrupt your internal filesystem.

nicla.zip (6.9 MB)

Sorry for the obvious question, but you do connect the antenna right? Also if are you in range of the access point? These boards don’t have a great range.

Really appreciate the idea iabdalkader. I just registered my board, not sure if that has any bearing on things. Yep, the antenna is fine.

I successfully installed “v4.6.20-110.g24e14d541.dirty”. Upon clicking the green run arrow everything works great (like the current released firmware). I can open the ip address and see the feed. I then click stop, and attempt to start again, with the run arrow… the board take a but longer than the first time to connect, but does eventually give me a “Waiting for connection.” status. Reloading the IP address in the browser times out at this point, and I can not get any feed.

It’s apparent that things tend to work well the first time following flashing the firmware, but subsequent disconnections and attempt to reconnect to wifi struggle and sometimes halt with a “Trying to connect” status. On occasion, connection will succeed and I will get a “Waiting for connection” status, however attempts to connect to the IP address over phone or laptop will always fail on these subsequent efforts.

Doing a fresh install of the firmware (either the released version or the dev version you shared), and then running the streaming example seems to solve the issue with a somewhat consistent (but definitely not perfect) success rate, allowing me to sometimes access the feed again via an initial attempt.

Best I can tell, the board is freezing up during attempt to connect to the Wifi, working sometimes, and then getting stuck. It seems like perhaps something on the board is not being adequately reset to allow repeat connection. Not sure if you can use that to troubleshoot.

Happy to share additional details, record a video or do a screen sharing session if that’d help your efforts, which I very much appreciate.

The only thing I can think of is the WiFi/BT firmware, which gets deployed every time you flash the firmware. But that area of flash becomes read-only afterward, and the board doesn’t store anything there. Unless it gets corrupted somehow, I don’t see why reflashing the firmware helps.
Other than that, the WiFi module itself might be caching some connection info in its memory (volatile or non-volatile it’s unknown).

Here’s what you could try that would be helpful:

  1. Try MicroPython upstream here: and see if the same issue happens with that
  2. Try the Arduino firmware.
  3. Try an access point (hotspot) on your phone. On iOS there’s a “maximize compatibility” mode, if I remember correctly, try with/without.

If the issue persists, with MicroPython upstream and Arduino’s firmware, and/or the hotspot works, then it’s definitely your access point, and there’s nothing else we can do on our end. Note I checked the my connection here, works well with these modules, and it’s WPA2 not 3.

Ok, thanks very much.

1 - I installed the latest firmware available at the link you provided via the OpenMV IDE. Following that, the IDE doesn’t recognize the board when plugged in anymore, giving a “Timeout error while getting firmware version!” message. Maybe a different workflow is intended.
2. … will get to this, however I’m not sure exactly which example in the Arduino IDE list of examples to try and what to do with it.
3. Great idea. I did this…

  • First, with my phone connected to 5G rather than my home wifi… the board connected and gave me a new IP address, this time associated with the hotspot. I can log into that IP address with a browser from my phone, but not my laptop. I can disconnect the board via the OpenMVIDE, and reconnect and this time something positive!.. I can successfully and consistently reestablish the stream and see it on my phone!
  • I’ve then tried the same thing, i.e. board to mobile hotsopt, and now with the phone connected to the home wifi… connected well on my phone first try… i stopped the board… restarted it… works great over my phone. Can’t see the stream over my laptop’s browser, but it is showing up within the OpenMV IDE. This is great.
  1. Following the above, I have saved the script as main.py, and connected the board only to power (not my laptop’s USB)… the board successfully connects and I can see the stream on my phone’s browser, but the feed to the OpenMV IDE is no longer available and the laptop, which is connected to the Wifi, can’t access the feed via the board’s IP address (while the phone can).

  2. Next, I’ve tried to connected my laptop to my phone’s hotspot.. rather than directly to the home wifi… doesn’t seem to do anything… while my phone still has a reliable stream, my laptop and the OpenMV IDE still can’t access have the stream. So, whether the laptop is connected to mobile hotspot or directly to wifi, it can’t access the stream.

I will add this: my laptop is managed by my workplace, and I’m wondering if the firewall settings might be causing issues. Or, it seems it could be my wifi connection could be the root cause.

Ultimately it seems we’re closer, but to remotely gather the image data, I need the feed to get back to my laptop, right?

Hopefully this update makes sense. Thanks for the suggestions.

If you install MicroPython upstream the IDE will no longer recognize the board. You could use a serial terminal, something like screen or minicom or maybe Thonny. Also our modules and libraries will not be available, so you should only test WiFi.

I wouldn’t bother testing anything else, it sounds like the issue is indeed with your laptop or workplace access point or both. I don’t know how to fix that, maybe check with your IT admin?