Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldnt find backpack #1

Closed
lesharodin opened this issue Nov 30, 2023 · 21 comments
Closed

Couldnt find backpack #1

lesharodin opened this issue Nov 30, 2023 · 21 comments
Labels
bug Something isn't working

Comments

@lesharodin
Copy link

lesharodin commented Nov 30, 2023

Windows + esp32 (fresh fw) + beta3 plugin
Start log:
v1.0.0-beta.3
Attempting to find backpack
Attempting to find backpack on COM6 - It detects port correctly
Could not find connected backpack. Ending connector thread.

I added extra logger to see if it detect a port

        for port in ports:
            s.port = port.device
            
            try:
                s.open()
                logger.info(f"Attempting to find backpack on {port.device}")
            except:
                continue

Tried to replug esp several times, didt help

For some reason it didnt fall back to
logger.warning('Failed to write to open serial device. Attempting to connect to new device...')

Only straight to closing port

@i-am-grub i-am-grub added the bug Something isn't working label Dec 1, 2023
@i-am-grub
Copy link
Owner

What board(s) are you using again? Is it just the standard DevKitC?

@lesharodin
Copy link
Author

What board(s) are you using again? Is it just the standard DevKitC?

Just a standart NodeMCU ESP32 boards, I dont think the problem is with boards because if flashes well and it worked well on previous versions.

@i-am-grub
Copy link
Owner

What board(s) are you using again? Is it just the standard DevKitC?

Just a standart NodeMCU ESP32 boards, I dont think the problem is with boards because if flashes well and it worked well on previous versions.

The plugin has been primarily been developed on a Windows PC, so initially I don't think the code base is the issue right now. You've mentioned having issues with other beta versions in the past, especially on Windows, so I wonder it if could be a driver issue.

Drivers for the typical USB to serial converter chips that are used on the ESP32s can be found here

@i-am-grub
Copy link
Owner

Another thing to try is to add a logging line here

It could be closing the port because it wasn't receiving the right message from the esp32

@lesharodin
Copy link
Author

lesharodin commented Dec 1, 2023

Another thing to try is to add a logging line here

It could be closing the port because it wasn't receiving the right message from the esp32

Loaded plugin module VRxC_ELRS
v1.0.0-beta.3
Attempting to find backpack
Attempting to find backpack on COM7
Could not find connected backpack. Ending connector thread.

Added logger to line

s.close()
and it doesnt apper in log

image

@lesharodin
Copy link
Author

lesharodin commented Dec 1, 2023

What board(s) are you using again? Is it just the standard DevKitC?

Just a standart NodeMCU ESP32 boards, I dont think the problem is with boards because if flashes well and it worked well on previous versions.

The plugin has been primarily been developed on a Windows PC, so initially I don't think the code base is the issue right now. You've mentioned having issues with other beta versions in the past, especially on Windows, so I wonder it if could be a driver issue.

Drivers for the typical USB to serial converter chips that are used on the ESP32s can be found here

I dont think its a driver issue, I cant flash esp any time no problem.
I can run pkendall64 test message code no problem too. (ExpressLRS/Backpack#96)
I allready tried to uninstall/install recomended drivers.

@i-am-grub
Copy link
Owner

i-am-grub commented Dec 1, 2023

Does adding logger.info(response) before what's currently in line 154 give you anything?

@lesharodin
Copy link
Author

Does adding logger.info(response) before what's currently in line 154 give you anything?

Yes

Loaded plugin module VRxC_ELRS
v1.0.0-beta.3
Attempting to find backpack
Attempting to find backpack on COM7
[0, 248, 120, 120, 120, 120, 0, 128]
Could not find connected backpack. Ending connector thread.

@i-am-grub
Copy link
Owner

Does adding logger.info(response) before what's currently in line 154 give you anything?

Yes

Loaded plugin module VRxC_ELRS v1.0.0-beta.3 Attempting to find backpack Attempting to find backpack on COM7 [0, 248, 120, 120, 120, 120, 0, 128] Could not find connected backpack. Ending connector thread.

So it looks like its an issue with the backpack. the proper response should be
[36, 88, 62, 0, 128, 3, 6, 0]

@lesharodin
Copy link
Author

Does adding logger.info(response) before what's currently in line 154 give you anything?

Yes
Loaded plugin module VRxC_ELRS v1.0.0-beta.3 Attempting to find backpack Attempting to find backpack on COM7 [0, 248, 120, 120, 120, 120, 0, 128] Could not find connected backpack. Ending connector thread.

So it looks like its an issue with the backpack. the proper response should be [36, 88, 62, 0, 128, 3, 6, 0]

This is from another ESP module

Loaded plugin module VRxC_ELRS
v1.0.0-beta.3
Attempting to find backpack
Attempting to find backpack on COM1
[36, 88, 62, 0, 16, 0, 6, 0]
Could not find connected backpack. Ending connector thread.

@i-am-grub
Copy link
Owner

i-am-grub commented Dec 1, 2023

If you change msptypes.MSP_ELRS_BACKPACK_SET_MODE to msptypes.MSP_ELRS_GET_BACKPACK_VERSION here, that should get the second ESP module to work with the old backpack firmware.

I thought that the firmware in the beta 2 was suppose to support that, but it looks like I forgot about the config changes I made for the elrs pull request. I'll just those update, thanks for the help!

@lesharodin
Copy link
Author

If you change msptypes.MSP_ELRS_BACKPACK_SET_MODE to msptypes.MSP_ELRS_GET_BACKPACK_VERSION here, that should get the second ESP module to work with the old backpack firmware.

I thought that the firmware in the beta 2 was suppose to support that, but it looks like I forgot about the config changes I made for the elrs pull request. I'll just those update, thanks for the help!

Yes, it works now:

v1.0.0-beta.3
Attempting to find backpack
Attempting to find backpack on COM1
[36, 88, 62, 0, 16, 0, 6, 0]
Connected to backpack on COM1
Backpack version: master

@lesharodin
Copy link
Author

Maybe you need to leave that extra loggers in code just for future user debugging :)

@i-am-grub
Copy link
Owner

yup you are right, they are going to be pushed up to master fairly soon. If you wanted to test with the updated firmware, I did switch out the esp32 firmware that was included with the beta.3 release

@lesharodin
Copy link
Author

lesharodin commented Dec 1, 2023

yup you are right, they are going to be pushed up to master fairly soon. If you wanted to test with the updated firmware, I did switch out the esp32 firmware that was included with the beta.3 release

Flashed with https://github.com/i-am-grub/VRxC_ELRS/releases/download/v1.0.0-beta.3/firmware-esp32.zip
And return

if mode == msptypes.MSP_ELRS_BACKPACK_SET_MODE:

Loaded plugin module VRxC_ELRS
v1.0.0-beta.3
Attempting to find backpack
Attempting to find backpack on COM1
[120, 128, 0, 120, 128, 120, 0, 120]
Could not find connected backpack. Ending connector thread.

@lesharodin
Copy link
Author

lesharodin commented Dec 1, 2023

Hmm now its connected.. Didnt change anything

Loaded plugin module VRxC_ELRS
v1.0.0-beta.3
Attempting to find backpack
Attempting to find backpack on COM7
[36, 88, 62, 0, 128, 3, 6, 0]
Connected to backpack on COM7
Backpack version: master

Another ESP too (reflashed)

v1.0.0-beta.3
Attempting to find backpack
Attempting to find backpack on COM6
[36, 88, 62, 0, 128, 3, 6, 0]
Connected to backpack on COM6
Backpack version: master

@i-am-grub
Copy link
Owner

Every time the esp is rebooted, it will send out a bunch of messages over serial during it's startup process. If Windows tries to communicate too early, it receives a bunch of junk back as a response as shown in one of your earlier messages.

@lesharodin
Copy link
Author

I can test esp8286 too, shoud I build it from you PR ExpressLRS/Backpack#114 ?

@i-am-grub
Copy link
Owner

yes please. I don't have any firmware currently compiled for the 8266 yet

@lesharodin
Copy link
Author

lesharodin commented Dec 1, 2023

yes please. I don't have any firmware currently compiled for the 8266 yet

Esp8266 works too
Loaded plugin module VRxC_ELRS
v1.0.0-beta.3
Attempting to find backpack
Attempting to find backpack on COM6
[36, 88, 62, 0, 128, 3, 6, 0]
Connected to backpack on COM6
Backpack version: master

didnt actually test osd messages yet, will test later, but it was working with diferent code before

@i-am-grub
Copy link
Owner

Just had some new devkits show up, and they gave me the same issue where they wouldn't connect to Windows. it looks like adding in this sleep fixes it for some reason.

sleep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants