wifi_jpeg_streamer example issues

Discussions about the AI-deck
jmiguel
Beginner
Posts: 5
Joined: Mon Mar 07, 2022 8:21 pm

wifi_jpeg_streamer example issues

Post by jmiguel »

Hello everyone,
I am trying to make the wifi_jpeg_streamer work in my AI-deck. The problem is that for some reason the file frame_streamer.h cannot be found. The route seems to be ok. I have not modified anything in the source code. I have also downgraded the version for the gap_sdk to 3.8.1. and I am following the instructions on the documentation. I have no problem with other examples using the JTAG debugger, but now I want to use the wifi connection. I cannot continue with the example without fixing this error.

Has anyone had this problem?

thanks in advanced

test.c:4:10: fatal error: tools/frame_streamer.h: No such file or directory
#include "tools/frame_streamer.h"
^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: wifi_jpeg_streamer example issues

Post by marcus »

Hi!

I've run into this issue, if I remember correctly it was when I bumped the SDK version where this file isn't included in the build. Could you double check that you're using the 3.8.1 version and also make clean before building?

We've updated the examples today, so depending a bit on what you want to do you could also try out the new version of the streamer. If you want to do this then you need to do the following:

Update the crazyflie-firmware firmware and run make menuconfig. Go to the menu Expansion deck configuration->Support the AI-deck->WiFi setup. Here you can either select the AI-deck to act as access-point or to connect to an access point. Either way, you need to set the SSID (and PASSWD if needed). Build and flash the firmware.

Clone the new ESP32 firmware, build and flash it using the JTAG (the easiest is to use our toolbelt for it).

Lastly update to the latest version of the AIdeck examples and build/flash the GAP8 (here's the instruction for the new example).

Let me know how it goes!
jmiguel
Beginner
Posts: 5
Joined: Mon Mar 07, 2022 8:21 pm

Re: wifi_jpeg_streamer example issues

Post by jmiguel »

Hi Marcus!
Thank you for your help!. At this time I have managed to flash the crazy-firmware, and configure it throw the new menu. But now I am struggling with the flash of the ESP32 firmware. I cannot get it flashed throw JTAG.

I guess the following:

$ source ~/path/to/idf/export.sh ---> my esp-idf installation directory

---> execute inside aideck-esp-firmware to build and flash:
$ idf.py build
$ idf.py -p /dev/ttyUSBX flash
$ idf.py monitor

The JTAG is working with other examples as "tet-camera"
I have tried with gap_sdk 3.8.1 and the latest version as well

It's driving me crazy ;)

Thanks
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: wifi_jpeg_streamer example issues

Post by marcus »

I'm not sure, but I think the flash command is only for UART flashing, which isn't possible via the JTAG connector on the AI-deck. I would recommend using our docker container for this. The following command will flash the bootloader/app on the ESP32 with the Olimex USB Tiny-H:

Code: Select all

docker run --rm -it -v $PWD:/module/ --device /dev/ttyUSB0 --privileged -P bitcraze/builder /bin/bash -c "openocd -f interface/ftdi/olimex-arm-usb-tiny-h.cfg -f board/esp-wroom-32.cfg -c 'adapter_khz 20000' -c 'program_esp build/bootloader/bootloader.bin 0x1000 verify' -c 'program_esp build/aideck_esp.bin 0x10000 verify reset exit'"
jmiguel
Beginner
Posts: 5
Joined: Mon Mar 07, 2022 8:21 pm

Re: wifi_jpeg_streamer example issues

Post by jmiguel »

Hi Marcus,
I'll try the docker option along this week.
Thanks for your help.
jmiguel
Beginner
Posts: 5
Joined: Mon Mar 07, 2022 8:21 pm

Re: wifi_jpeg_streamer example issues

Post by jmiguel »

Hi again, getting closer but still problems to run it...

I have started again from scratch using docker. I've flashed the code for the example into the AI-deck using the docker. When I try to flash the ESP32 firmware using the docker I get the following trace:

=======================================================================
Open On-Chip Debugger v0.10.0-esp32-20210401 (2021-04-01-15:45)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
adapter speed: 20000 kHz

Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 20000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : Listening on port 3333 for gdb connections
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Error: Couldn't halt target before SoC reset
embedded:startup.tcl:449: Error: ** Unable to reset target **
in procedure 'program_esp'
in procedure 'program_error' called at file "/new_home/.espressif/tools/openocd-esp32/v0.10.0-esp32-20210401/openocd-esp32/bin/../share/openocd/scripts/target/esp_common.cfg", line 85
at file "embedded:startup.tcl", line 449

======================================================

Despite this, I can connect my laptop to the AP, but when running the command:
python opencv-viewer.py -n 192.168.4.1

I get stuck on "socket connected" but the viewer does never start.


Any ideas..??

Thank you!!
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: wifi_jpeg_streamer example issues

Post by marcus »

Did you program the GAP8 as well? If so then also check that it's running (LED2 should be blinking), is it?
jmiguel
Beginner
Posts: 5
Joined: Mon Mar 07, 2022 8:21 pm

Re: wifi_jpeg_streamer example issues

Post by jmiguel »

After flashing aideck-gap8-bootloader using docker, the LED2 flashes in green.

From this point I understand that I have to flash Aideck ESP firmware, and then flash image streamer example?
If I use docker:


docker run --rm -it -v $PWD:/module/ --device /dev/ttyUSB0 --privileged -P bitcraze/builder /bin/bash -c "openocd -f interface/ftdi/olimex-arm-usb-tiny-h.cfg -f board/esp-wroom-32.cfg -c 'adapter_khz 20000' -c 'program_esp build/bootloader/bootloader.bin 0x1000 verify' -c 'program_esp build/aideck_esp.bin 0x10000 verify reset exit'"


docker run --rm -it -v $PWD:/module/data/ --device /dev/ttyUSB0 --privileged -P bitcraze/aideck:4.8.0 /bin/bash -c 'export GAPY_OPENOCD_CABLE=interface/ftdi/olimex-arm-usb-tiny-h.cfg; source /gap_sdk/configs/ai_deck.sh; cd /module/data/; make clean all image flash'

python opencv-viewer.py -n 192.168.4.1


Is that allright?
Thanks
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: wifi_jpeg_streamer example issues

Post by marcus »

The first part for the ESP should be correct, but if you would like to use the WiFi bootloader you should flash your application with the python script in the aideck-gap8-bootloader repository. There's more information here.
sitsaw17
Beginner
Posts: 3
Joined: Thu Mar 31, 2022 11:39 pm

Re: wifi_jpeg_streamer example issues

Post by sitsaw17 »

hi
i have a similar problem. I have flashed the esp firmware same as above and flash the wifi_jpeg_streaemr example to gap8 following the github instruction.
The problem is the wifi bitcraze_example does not appear but the led is blinking as you said
Post Reply