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

Connect via socket #95

Open
Phunkafizer opened this issue Jan 28, 2020 · 6 comments
Open

Connect via socket #95

Phunkafizer opened this issue Jan 28, 2020 · 6 comments
Labels

Comments

@Phunkafizer
Copy link

Is there be a possibility to connect via socket instead of serial port?

E. g.

{
  "plugin": "homeduino",
  "driver": "socket",
  "driverOptions": {
    "host": "pi2.local",
    "port": 1752
  }
}
@mwittig
Copy link
Contributor

mwittig commented Jan 28, 2020

Generally this is not supported at the moment, but it would be just a matter of implementing another driver in homeduinojs (see link below). The question is, however, what should what kind of implementation should be running on the receiver side (the board with transmitter and receiver). What are you trying to achieve?

https://github.com/pimatic/homeduinojs/tree/master/lib/driver

@Phunkafizer
Copy link
Author

Phunkafizer commented Jan 28, 2020 via email

@mwittig
Copy link
Contributor

mwittig commented Jan 29, 2020

Makes sense to me. One of approach of doing this is to have a standalone application around homeduinojs. As part of this a UDP (or TCP) SerialPort bridge could be easily implemented to transmit serial port data via IP. For example, see udp-serialport which, however, is outdated as it has been built for a deprecated version of node-serialport.

Another approach is to build a RF Gateway which uses some higher layer protocol (e.g. Pimatic REST-API or MQTT) to send/receive command and status messages which map to pimatic devices. Some interesting work has been done in the past around the idea to implement a RF gateway on ESP8266. These projects are no longer maintained but if you are a developer it is worth having a look.

@Phunkafizer
Copy link
Author

Thank you for the links! The 1st project seems to work with http calls and only in receive-direction. The second project looks interessting, but it seems pimatic does not support UDP directly and needs a ESP8266 as an interface between UDP and serial. Is there a way to bring in the "UDP level" directly in pilight (or it's homeduino plugin)? This way a lot of overhead (MQTT, HTTP, ESP8266 interface) could be left out.

@louisvangeldrop
Copy link

Maybe a set of HC-12 serial transceivers may help you. One connects to the rx/tx of the arduino and the other to the USB port of the Raspberry Pi. For the homeduino plugin it looks as locally connected serial device.

@louisvangeldrop
Copy link

Another solution is to use pigpio-client. It supports remote access to the pigpiod-daemon running at a remote Raspberry-pi. A raspberrypi-zero W e.g. can handle the interrupts when using the glitchfilter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants