jeanlemotan / esp32-cam-fpv

esp32 cam digital low latency fpv
MIT License
304 stars 75 forks source link

Laptop build #36

Open Yury-MonZon opened 1 year ago

Yury-MonZon commented 1 year ago

Hi there! Pop OS 6.1.11-76060111-generic #202302091138~1675975749~22.04~f771a7f SMP PREEMPT_DYNAMIC Thu F x86_64 x86_64 x86_64 GNU/Linux here. HW: TL-WN722N v2 card with this fix. Airdump-ng works fine - tested it.

$ sudo -E DISPLAY=:0 ./gs (I) src/PI_HAL.cpp: 286: Drivers: 4 (I) src/PI_HAL.cpp: 289: Driver 0: x11 (I) src/PI_HAL.cpp: 289: Driver 1: wayland (I) src/PI_HAL.cpp: 289: Driver 2: KMSDRM (I) src/PI_HAL.cpp: 289: Driver 3: dummy (I) src/PI_HAL.cpp: 298: Mode -1: 455844177x671522212 (E) src/PI_HAL.cpp: 317: Cannot create window: No available video device (E) src/PI_HAL.cpp: 604: Cannot initialize display Segmentation fault or

`$ sudo -E ./gs (I) src/PI_HAL.cpp: 286: Drivers: 4 (I) src/PI_HAL.cpp: 289: Driver 0: x11 (I) src/PI_HAL.cpp: 289: Driver 1: wayland (I) src/PI_HAL.cpp: 289: Driver 2: KMSDRM (I) src/PI_HAL.cpp: 289: Driver 3: dummy (I) src/PI_HAL.cpp: 298: Mode 0: 1366x768 ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile vertex shader! 0:1(10): error: GLSL 1.30 is not supported. Supported versions are: 1.00 ES, 3.00 ES, 3.10 ES, and 3.20 ES

ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile fragment shader! 0:1(10): error: GLSL 1.30 is not supported. Supported versions are: 1.00 ES, 3.00 ES, 3.10 ES, and 3.20 ES

ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to link shader program! error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader (E) src/imgui_impl_opengl3.cpp: 382: GL error 1282 in glShaderSource(shaderData.VertHandle, 2, vertex_shader_with_version, NULL) file src/imgui_impl_opengl3.cpp line 382 ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile vertex shader! 0:1(10): error: GLSL 1.30 is not supported. Supported versions are: 1.00 ES, 3.00 ES, 3.10 ES, and 3.20 ES

ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile fragment shader! 0:1(10): error: GLSL 1.30 is not supported. Supported versions are: 1.00 ES, 3.00 ES, 3.10 ES, and 3.20 ES

ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to link shader program! error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader (E) src/imgui_impl_opengl3.cpp: 477: GL error 1282 in glGenBuffers(1, &g_VboHandle) file src/imgui_impl_opengl3.cpp line 477 (I) src/Comms.cpp: 718: Radiocap header size: 11, IEEE header size: 24 (I) src/Comms.cpp: 581: Opening interface wlxac15a2eb4253 in monitor mode (E) src/Comms.cpp: 623: Error in pcap_activate: That device doesn't support monitor mode ` What's my problem there? Thanks

jeanlemotan commented 1 year ago

The problem seems to be this: 0:1(10): error: GLSL 1.30 is not supported. Supported versions are: 1.00 ES, 3.00 ES, 3.10 ES, and 3.20 ES Can you comment this code and try?

    if (glsl_version == NULL)
        glsl_version = "#version 130";
    IM_ASSERT((int)strlen(glsl_version) + 2 < IM_ARRAYSIZE(g_GlslVersionString));
    strcpy(g_GlslVersionString, glsl_version);
    strcat(g_GlslVersionString, "\n");

It's in the imgui_impl_opengl3.cpp file, line 107.

Yury-MonZon commented 1 year ago

Commented this block out. And I get this:

`$ sudo -E DISPLAY=:0 ./gs (I) src/PI_HAL.cpp: 286: Drivers: 4 (I) src/PI_HAL.cpp: 289: Driver 0: x11 (I) src/PI_HAL.cpp: 289: Driver 1: wayland (I) src/PI_HAL.cpp: 289: Driver 2: KMSDRM (I) src/PI_HAL.cpp: 289: Driver 3: dummy (I) src/PI_HAL.cpp: 298: Mode -1: 947570897x1420212923 (E) src/PI_HAL.cpp: 317: Cannot create window: No available video device (E) src/PI_HAL.cpp: 604: Cannot initialize display Segmentation fault

$ sudo -E ./gs (I) src/PI_HAL.cpp: 286: Drivers: 4 (I) src/PI_HAL.cpp: 289: Driver 0: x11 (I) src/PI_HAL.cpp: 289: Driver 1: wayland (I) src/PI_HAL.cpp: 289: Driver 2: KMSDRM (I) src/PI_HAL.cpp: 289: Driver 3: dummy (I) src/PI_HAL.cpp: 298: Mode 0: 1366x768 (I) src/Comms.cpp: 718: Radiocap header size: 11, IEEE header size: 24 (I) src/Comms.cpp: 581: Opening interface wlxac15a2eb4253 in monitor mode (E) src/Comms.cpp: 623: Error in pcap_activate: That device doesn't support monitor mode ` But my wlan card works in monitor mode.

Ncerzzk commented 1 year ago

can you test with sudo tcpdump --monitor-mode -i wlxac15a2eb4253 I'm sorry that I know little about Airdump-ng generally in my test case, if the tcpdump operating netcard works fine, gs can work too.

Yury-MonZon commented 1 year ago

Sadly, it doesn't work this way: tcpdump: wlxac15a2eb4253: That device doesn't support monitor mode I think I can try to fix it later on.

But the main problem here is that I'm not passed the video issue yet. Would really appreciate your help here: sudo -E DISPLAY=:0 ./gs (I) src/PI_HAL.cpp: 286: Drivers: 4 (I) src/PI_HAL.cpp: 289: Driver 0: x11 (I) src/PI_HAL.cpp: 289: Driver 1: wayland (I) src/PI_HAL.cpp: 289: Driver 2: KMSDRM (I) src/PI_HAL.cpp: 289: Driver 3: dummy (I) src/PI_HAL.cpp: 298: Mode -1: 947570897x1420212923 (E) src/PI_HAL.cpp: 317: Cannot create window: No available video device (E) src/PI_HAL.cpp: 604: Cannot initialize display Segmentation fault

Thanks a lot!

Ncerzzk commented 1 year ago

please exec printenv to get your DISPLAY info first and try sudo -E DISPLAY=XX ./gs replace XX to your display,example: :0.0

Yury-MonZon commented 1 year ago

No video problems so far. Thanks. I'll try to find my monitor mode problem. $ sudo -E DISPLAY=:1 ./gs (I) src/PI_HAL.cpp: 286: Drivers: 4 (I) src/PI_HAL.cpp: 289: Driver 0: x11 (I) src/PI_HAL.cpp: 289: Driver 1: wayland (I) src/PI_HAL.cpp: 289: Driver 2: KMSDRM (I) src/PI_HAL.cpp: 289: Driver 3: dummy (I) src/PI_HAL.cpp: 298: Mode 0: 1366x768 (I) src/Comms.cpp: 718: Radiocap header size: 11, IEEE header size: 24 (I) src/Comms.cpp: 581: Opening interface wlxac15a2eb4253 in monitor mode (E) src/Comms.cpp: 623: Error in pcap_activate: That device doesn't support monitor mode

Yury-MonZon commented 1 year ago

Just to be sure: I should see beacons and acknowledgements, right? Then it works fine with sudo tcpdump -l -i wlan0 (not sure about -L key) after I put it in monitor mode with my script.

Ncerzzk commented 1 year ago

why remove --monitor-mode option?

Yury-MonZon commented 1 year ago

Because I have to put my card into the monitor mode via script. Can you provide some info on what tcpdump prints out on a properly working setup?

Ncerzzk commented 1 year ago

sudo tcpdump --monitor-mode -i wlxac15a2eb4253 just a command to test whether your netcard could be operated well, it would put your card to monitor mode automatically(if it support), you don't need other script. if it runs ok(no error), you can directly use sudo ./gs.

Yury-MonZon commented 1 year ago

Tcpdump can't put my card into monitor mode for some reason. I have TP-WN722N v2. But after I put my card manually into monitor mode I can run sudo tcpdump -i wlxac15a2eb4253: `sudo tcpdump -i wlxac15a2eb4253

tcpdump: verbose output suppressed, use -v[v]... for full protocol decode listening on wlxac15a2eb4253, link-type IEEE802_11_RADIO (802.11 plus radiotap header), snapshot length 262144 bytes

09:58:39.321561 1.0 Mb/s 2412 MHz 11b -81dBm signal antenna 0 Beacon (SSID_NAME) [1.0 2.0 5.5 11.0 9.0 18.0 36.0 54.0 Mbit] ESS CH: 4, PRIVACY

09:58:39.350210 11.0 Mb/s 2412 MHz 11b -83dBm signal antenna 0 Data IV:fc2606 Pad 20 KeyID 1

09:58:39.374229 1.0 Mb/s 2412 MHz 11b -95dBm signal antenna 0 Beacon (SSID_NAME) [1.0 2.0 5.5 11.0 18.0 24.0 36.0 54.0 Mbit] ESS CH: 1, PRIVACY

09:58:39.380601 1.0 Mb/s 2412 MHz 11b -87dBm signal antenna 0 Beacon (SSID_NAME) [1.0 2.0 5.5 11.0 18.0 24.0 36.0 54.0 Mbit] ESS CH: 1, PRIVACY

09:58:39.387989 1.0 Mb/s 2412 MHz 11b -79dBm signal antenna 0 Beacon (SSID_NAME) [1.0 2.0 5.5 11.0 6.0 9.0 12.0 18.0 Mbit] ESS CH: 3, PRIVACY

09:58:39.462364 1.0 Mb/s 2412 MHz 11b -83dBm signal antenna 0 Beacon (SSID_NAME) [1.0 2.0 5.5 11.0 18.0 24.0 36.0 54.0 Mbit] ESS CH: 1, PRIVACY

09:58:39.462366 1.0 Mb/s 2412 MHz 11b -83dBm signal antenna 0 Data IV:a071d1 Pad 20 KeyID 1 ` So, I suppose tcpdump works. Is there a way to not enable monitor mode with tcpdump in gs?

Ncerzzk commented 1 year ago

gs didn't contain tcpdump. tcpdump for me is just used for test netcard.

try to remove if (pcap_set_rfmon(pcap.pcap, 1) < 0) https://github.com/jeanlemotan/esp32-cam-fpv/blob/adc1e5c040bada4780de0db60716af411d326435/gs/src/Comms.cpp#LL599C9-L599C23

Yury-MonZon commented 1 year ago

Thanks a lot! Now I'm getting somewhere - I can see the GS screen with HAL menu.

But sad news - my camera is borked, so I'll have to wait for a new one (confirmed with another code as well).

Is there an easy way to make esp32 send dummy frames(like the camera is there) so I can play with the link range etc?

Ncerzzk commented 1 year ago

you can package a static jpeg into c header, then send it by call camera_data_available manually