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

data not writing to GPIO? #5

Closed
pinige opened this issue Aug 17, 2023 · 14 comments
Closed

data not writing to GPIO? #5

pinige opened this issue Aug 17, 2023 · 14 comments

Comments

@pinige
Copy link

pinige commented Aug 17, 2023

Please can you point me in the right direction?

video streams ok..
PS4 controller sends data ok..

On the Raspberry Pi I receive data.. like this:
[Streamer]: [udplus]0029connection|number3000
[Streamer]: [udplus]0030car-control|object{"axes":{"0":0.127,"1":1,"2":0,"3":0},"paddles":{"left":0,"right":0},"buttons": "L1":0,"R1":0,"square":0,"triangle":0}}

But nothing goes to the GPIO pins.
Also, on the browser page nothing happens when I click on the "start" button - it always says "offline"

Please can you point me to where I need to look?
Many thanks for all your help and patience.
Nigel

@kwawmannanjnr
Copy link

lets collab!

@Pexeus
Copy link
Owner

Pexeus commented Aug 28, 2023

Hello, the log indicates that you are getting the data from the webclient to the PI. So i suspect a hardware issue.

  • is the wiring correct?
  • are the servos getting the power they need?
  • did you choose the right Pins?

Also the connection issue could be network related, or a misconfiguration in the config file

@pinige
Copy link
Author

pinige commented Sep 2, 2023

Hi,
The wiring is correct - I have tried the servo test in onboard\dev\servos.js and they work fine.
The config.json file is as follows:
"host":"192.168.1.87", (My PC's IP address)
"port_http":"1300",
"port_udp":"3000",
And the video streams perfectly.

Is there something else I should be configuring ?

Does the console.log from the Pi look correct?
This is the output on the onboard Pi:

Sending to: 192.168.1.87:3000
Streamer: [udplus]0029connection|number3000
Streamer: [udplus]0030car-control|object{"axes":{"0":-1,"1":0,"2":0,"3":0},"paddles":{"left":0,"right":0},"buttons":{"L1":0,"R1":0,"square":0,"triangle":0}}
Sending to: 192.168.1.87:3000

Many thanks for your help
Nigel

@Pexeus
Copy link
Owner

Pexeus commented Sep 5, 2023

Its my fault. the client uses an in dev build of my UDPlus Library, but the server uses the current build from NPM. i suspect they are incompatible. im gonna try and look it up, but you can also try and implement it urself. thats the package: https://www.npmjs.com/package/udplus

@pinige
Copy link
Author

pinige commented Sep 14, 2023

I've tried again using the same package on the Pi (onboard) and the server (as you suggested) but it still does the same thing.

Does this output that appears on the onboard Pi look correct?
[Streamer]: [udplus]0030car-control|object{"axes":{"0":0,"1":0,"2":0,"3":0},"paddles":{"left":0,"right":0},"buttons":{"L1":0,"R1":0,"square":0,"triangle":0}}
Sending to: 192.168.1.87:3000

I'm not sure where to look next?

@kwawmannanjnr
Copy link

i'm having issues as well! Maybe we can debug on Zoom or something

@Pexeus
Copy link
Owner

Pexeus commented Oct 10, 2023

Just Pushed some changes, try it out now! If it still doesnt work, tell me

@pinige
Copy link
Author

pinige commented Oct 11, 2023

I have started with a fresh install - I now get error:

UDP Connection Ready: 192.168.1.81:3000
/home/pi/LTE-Car/onboard/index.js:13
stream.init(udpClient, config)
^

ReferenceError: udpClient is not defined
at /home/pi/LTE-Car/onboard/index.js:13:21
at EventEmitter.events.connect (/home/pi/LTE-Car/onboard/node_modules/udplus/index.js:197:9)
at init (/home/pi/LTE-Car/onboard/index.js:10:18)
at Object. (/home/pi/LTE-Car/onboard/index.js:19:1)
at Module._compile (internal/modules/cjs/loader.js:1114:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
at Module.load (internal/modules/cjs/loader.js:979:32)
at Function.Module._load (internal/modules/cjs/loader.js:819:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
at internal/main/run_main_module.js:17:47

I then changed ....\onboard\index.js
from
stream.init(udpClient, config)
control.init(udpClient, config)
telemetry.init(udpClient, config)
to
stream.init(udplusClient, config)
control.init(udplusClient, config)
telemetry.init(udplusClient, config)

I now get:

UDP Connection Ready: 192.168.1.81:3000
Initiating stream
Initiating controls
Initiating telemetry

... but the video is not streaming :-(

@Pexeus
Copy link
Owner

Pexeus commented Oct 12, 2023

Ok, ill debug this this weekend!

@pinige
Copy link
Author

pinige commented Oct 12, 2023 via email

@pinige
Copy link
Author

pinige commented Oct 13, 2023

I have just used the "old" server and the new "onboard".
After changing index.js (onboard/index.js) from "udpClient" to "udplusClient" on lines 13,14 & 15 it seems to work !

Hope this helps.

@Pexeus
Copy link
Owner

Pexeus commented Oct 16, 2023

Great! Can you make a pull request with those changes? I have a test setup ready myself now

@pinige
Copy link
Author

pinige commented Oct 16, 2023 via email

@pinige
Copy link
Author

pinige commented Nov 6, 2023

Hi Pexeus,
Apologies for messing you around - I have started from scratch (again) and downloaded your current version and it now works. I can only assume that the error was on my setup.
Thankyou once again for all your help and patience - This is an awesome project!
Very best regards
Nigel.

@pinige pinige closed this as completed Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants