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

Simple CLI example showing serial connection, subscribing to events and publishing messages #86

Open
timcash opened this issue May 3, 2024 · 7 comments · May be fixed by #95
Open

Simple CLI example showing serial connection, subscribing to events and publishing messages #86

timcash opened this issue May 3, 2024 · 7 comments · May be fixed by #95
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@timcash
Copy link

timcash commented May 3, 2024

The examples I see all use react and rxjs. A simple javascript / typescript cli app that shows all the functionality as a test would be very helpful to get started using this. I would be able to help improve it if someone could help me get started.

@Hunter275 Hunter275 added documentation Improvements or additions to documentation help wanted Extra attention is needed labels Jun 23, 2024
@Hunter275 Hunter275 linked a pull request Jun 30, 2024 that will close this issue
@Hunter275
Copy link
Member

I've got an extremely basic app in #95

Going to write up a README for it tomorrow

@Hunter275 Hunter275 linked a pull request Jun 30, 2024 that will close this issue
@Hunter275
Copy link
Member

@timcash @michaelachrisco

Check out #95 (https://github.com/Hunter275/js/tree/example/example)

Let me know if you have any issues starting the app or anything

@michaelachrisco
Copy link

Ill give it a shot after work. Thanks @Hunter275

@TheCyberRonin
Copy link
Contributor

@timcash @michaelachrisco

Check out #95 (https://github.com/Hunter275/js/tree/example/example)

Let me know if you have any issues starting the app or anything

I just got into Meshtastic and I have a good amount of JS experience. That example uses HttpConnection and not SerialConnection like this issue is asking for. I also wanted to toy around to get this to work for myself.
What I've found is that the web serial API is not the same as in NodeJS. You can avoid the failure of navigator.serial if you use the popular serialport, but you run into issues down the line. What would have to happen is to essentially have another type of connection that would support serialport bindings and be able to be used for node. Something like NodeSerialConnection. You could also probably have it extend SerialConnection and fill in the gaps.

@Hunter275
Copy link
Member

@TheCyberRonin

I've only recently taken over this repo, and have not spent much time in it yet, I'm more focused on the web repo currently.

If you're willing to submit a PR with NodeSerialConnection to support serialport, even as a proof of concept, that would be awesome. If all goes well, we can assess what it would take to swap navigator.serial if we so desire.

@TheCyberRonin
Copy link
Contributor

@Hunter275 I'd be more than happy to try that out! When I have some free time I'll port that over and see what shakes out.

@TheCyberRonin
Copy link
Contributor

@Hunter275 just an update, I got it kind of working. I think I need to alter some things and make a separate transform for Node as well. It doesn't error when I build and connect to my heltec via serial, but it does shut my device down lol. So it's communicating, just got some signals crossed it seems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants