Issue with new wifi-img-streamer example

Discussions about the AI-deck
lucdani12
Beginner
Posts: 10
Joined: Sun Apr 24, 2022 10:37 am

Issue with new wifi-img-streamer example

Post by lucdani12 »

Hi to all,
i had problems with bootloader, but after purchasing the ARM-USB-OCD-H and flashing the bootloader with the docker aideck 4.8.0.1 (as said in the instructions), i managed to stream the camera video on my pc. I get on avg 7 fps, and it works with aideck acting as access point and also if i connect it to my home wifi.
I also can use the cfclient to control the crazyflie but then the framerate drops a bit, but still usable.
The real problem is that, if i abort the script opencv-viewer.py with ctrl+c and turn off the drone, when i turn on it, the gap8 led doesn't blink anymore. The only way to get it back working is to turn off the drone again, wait for about 1 minute, and then turn on again the crazyflie, and the led starts to blink and all works.
So, i can imagine that the aideck work is still in progress, but i ask if this problem is known or affects only me. Since i have to write my master thesis on it, i would to not have such type of unstability...
Thanks for yours time and for yours help.
Luca
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Issue with new wifi-img-streamer example

Post by marcus »

Hi Luca,

Yeah, we've seen this and it should be fixed in the latest firmware but there's still no release. Could you try to build the nRF and STM from source to see if this fixes the problem?
lucdani12
Beginner
Posts: 10
Joined: Sun Apr 24, 2022 10:37 am

Re: Issue with new wifi-img-streamer example

Post by lucdani12 »

Hi Marcus, thanks for your time.
Sorry the dumb question, but this stuff is so new for me... what do you mean with "build from source"? What i've done is to clone the repositories and then use the toolbelt, as said in the ai deck introduction tutorial.
Luca
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Issue with new wifi-img-streamer example

Post by marcus »

Hi Luca,

No problem! Yeah, this is what I meant by build from source. But it might be that we've updated it after you cloned it. So if you could pull the latest changes from the nRF and STM and rebuild/flash then this problem should be fixed. The repositories you need to update are the:
Just go into the directories and do git pull and this will download the latest version. Then you can rebuild it and flash it.
lucdani12
Beginner
Posts: 10
Joined: Sun Apr 24, 2022 10:37 am

Re: Issue with new wifi-img-streamer example

Post by lucdani12 »

Hi Marcus, thanks for your reply.
I reflashed the updated firmwares and also the esp firmware. Can you confirm that the actual tested method to flash the gap8 bootloader is the following ?

Code: Select all

docker pull bitcraze/aideck:4.8.0.1
docker run --rm -it -v $PWD:/module/ --device /dev/ttyUSB0 --privileged -P bitcraze/aideck:4.8.0.1 /bin/bash -c 'export GAPY_OPENOCD_CABLE=interface/ftdi/olimex-arm-usb-tiny-h.cfg; source /gap_sdk/configs/ai_deck.sh; cd /module/;  make clean all image flash'
I do the following steps:
1) turn on the crazyflie and i check that both aideck leds are flashing
2) i connect the arm-usb-ocd-h (in my case, i also change the string to fit my hardware, i think this is not a problem)
3) execute the commands
After this, all seems to be done, i get this string "RESET: jtag boot mode=3", only the nina led flashes, so i unplug the jtag connector, turn off the drone and turn on it. In this case the gap8 led blinks as normal, indicating that everything is fine.
Now, i think i have confusion with the "user image" that have to be flashed, in this case the wifi streaming example.
In which way i have to flash it? With the jtag? With the cfloader?
This is because if i proceed to flash using this code

Code: Select all

$ docker run --rm -v ${PWD}:/module aideck-with-container tools/build/make-example examples/other/wifi-img-streamer image
$ cfloader flash examples/other/wifi-img-streamer/BUILD/GAP8_V2/GCC_RISCV_FREERTOS/target.board.devices.flash.img deck-bcAI:gap8-fw -w radio://0/80/2M
(i changed make-examples file to fit my olimex ocd), when the script says "reset to bootloader mode...", the crazyflie restarts but aideck gap8 led wont blink and installation stucks at 2% (i saw that other guy has this problem).
After this, if i turn off and on the crazyflie, i have the problem that only nina flash, so i have to wait and turn on the crazyflie after 1 minute.
Thanks a lot.
Luca
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Issue with new wifi-img-streamer example

Post by marcus »

Yes, this procedure is ok. But the issue that the GAP8 get's "stuck" and you have to power it off for a long time is not caused by the GAP8 or EPS/Nina firmware, this is an issue with the nRF and STM. There's a change in the latest firmware that makes sure you cannot quickly power on/off the AI deck which will avoid this issue.

So to fix the issue you will have to flash this firmware. We're wokring on the release now so instead of building these from source you can flash them via the client. It's not the final release, but it's very close and should fix the problem you're having. I would recommend starting up the cfclient and going to the menu Connect->Bootloader. Connect to your Crazyflie and select the file 2022.05-rc2 - firmware-cf2-2022.05-rc2.zip. This will update the nRF/STM/ESP to the latest versions and this should fix the issue you're having (among other things).
lucdani12
Beginner
Posts: 10
Joined: Sun Apr 24, 2022 10:37 am

Re: Issue with new wifi-img-streamer example

Post by lucdani12 »

Hi Marcus!
Ok, i Will try. Thanks a lot for your clear explanation. I wish you good work!
Luca
lucdani12
Beginner
Posts: 10
Joined: Sun Apr 24, 2022 10:37 am

Re: Issue with new wifi-img-streamer example

Post by lucdani12 »

Goodmorning.
Unfortunately, i dont know why the wifi connection is so unstable. In particular, in the cfclient i receive this message, and then ubuntu kiks me out of aideck network.

Code: Select all

ESP32: I (62695) WIFI: station:fc:b3:bc:d6:74:ff join, AID=1
ESP32: I (154625) WIFI: Connection accepted
ESP32: I (154625) WIFI: Client connected
AIDECK-ROUTER: WiFi client connected
GAP8: Wifi client connection status: 1
ESP32: I (224485) WIFI: station:fc:b3:bc:d6:74:ffleave, AID=1
In facts, it seems to not handle both wifi connection and radio connection with the client.
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Issue with new wifi-img-streamer example

Post by marcus »

Ok, does it make any difference if you set up the AI deck as an access point? Did you have the AI deck attached when you updated to the ner version? This would have been noticeable since it takes a lot longer to update the firmware. If you're unsure you can run the update again with the AI deck attached (note that the rc2 release has been replaced with the official 2022.05 release).
lucdani12
Beginner
Posts: 10
Joined: Sun Apr 24, 2022 10:37 am

Re: Issue with new wifi-img-streamer example

Post by lucdani12 »

Hi Marcus.
The problem is that i have the AI deck attached when i update the firmware with the cfclient as you said, but when it restart automatically the crazyflie after the first update (i think the stm32), then the famous gap8 led doesnt blink and the updater only find the aideck esp, after updating it, it says it has done.
No difference if i turn on the drone and all leds blink. There is a way to "factory restore" the aideck to be sure nothing in firmware is broken?
Thanks
Luca

edit: i followed the new tutorial, and this is what my cfclient console tab looks like

Code: Select all

ESP32: I (130475) WIFI: station:fc:b3:bc:d6:74:ffleave, AID=1
ESP32: I (133015) WIFI: station:fc:b3:bc:d6:74:ff join, AID=1
GAP8: capture=63ms, encoding=0 ms (79056 bytes), transfer=674 ms
GAP8: capture=63ms, encoding=0 ms (79056 bytes), transfer=4582 ms
GAP8: capture=63ms, encoding=0 ms (79056 bytes), transfer=225 ms
GAP8: capture=63ms, encoding=0 ms (79056 bytes), transfer=53 ms
GAP8: capture=63ms, encoding=0 ms (79056 bytes), transfer=591 ms
ESP32: I (136925) WIFI: station:fc:b3:bc:d6:74:ffleave, AID=1
ESP32: I (155775) WIFI: station:fc:b3:bc:d6:74:ff join, AID=1
GAP8: capture=63ms, encoding=0 ms (79056 bytes), transfer=456 ms
GAP8: capture=63ms, encoding=0 ms (79056 bytes), transfer=20069 ms
GAP8: capture=63ms, encoding=0 ms (79056 bytes), transfer=150 ms
and so on untill the windows showing images crash.
Post Reply