1.0.1 • Published 6 years ago

irdtxserver v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

irdTxServer

The irdTxServer is a node.js application for the Gauge Data Transmitter. This application acts as a server that receives commands from data delegates (usually node.js applications incorporating the irdTxClass) over IPC. It then sends commands to battery powered gauges through infrared LEDs on the Gauge Data Transmitter's Daughterboard. The instructions in this README will install irdTxServer and set it to run as a service on reboot of the Raspberry Pi.

To communicate with this server, use the irdTxClass. The irdTxClass has testing and usage information see the irdTxClass testMe.js for more details. The irdTxClass can be added to your node.js application allowing it to act as a data delegate between your data and a custom gauge. It will handle the communications between your data source and the irdTxServer. The irdTxServer can support multiple IPC connections allowing one Gauge Data Transmitter to support several data delegates and therefore several physical gauges.

pic of Gauge Data Transmitter

Hardware Requirements

  1. Raspberry Pi Zero W
  2. WallGauge.com Gauge Data Transmitter Daughterboard.

Software Requirements (must be installed before Install)

  1. Raspbian Buster Lite
  2. Node.js v8.5 or newer
  3. git
  4. pigpio sudo apt-get update and then sudo apt-get install pigpio

Warning! Do not change the Raspberry Pi's video memory allocation from the default value. pigpio uses this memory for pin communications.

Install

On the Raspberry Pi Zero W from a SSH session:

  • type sudo mkdir /opt/rGauge if directory doesn't already exist.
  • type sudo chown pi:pi /opt/rGauge to make the user pi owner and the default group.
    • If your logged in as a user other than pi replace pi in the above command with your user name.
  • type cd /opt/rGauge. All rGauge apps are installed from this directory.
  • type git clone https://github.com/RuckerGauge/irdTxServer.git
    • This will create a new subdirectory and download the latest version of this node.js app.
  • type cd irdTxServer
  • type npm install to install all node dependences.
    • This will install the node.js dependencies and execute the commands in the postInstall/installAsService.sh bash file.

At this point the install is complete and the irdTxServer service should be up and running waiting for new connections. It has been installed as a service and will auto-start when rebooted. You can type journalctl -u irdTxServer -f to see the running process.


This install process will create a system group called irdclient. Applications wishing to submit data (client applications) to this server should be a member of this group. This allows client applications to be logged in with non-root level privileges and still communicate with the irdTxServer.

This install process also creates the /opt/rGauge/irdTxServer_socket directory and sets its default group to be irdclient. It will then set the group id bit on the directory. This forces the default group irdclient to be assigned to any new file created in this directory. The irdServer.js app will create an IPC socket file in the /opt/rGauge/irdTxServer_socket directory and give the default group write access to the file. See the postInstall/installAsService.sh file for details.

See the irdTxClass git hub repository to understand how to send commands to this server over IPC.

Gauge Data Transmitter Daughterboard

pic of Gauge Data Transmitter The gauge data transmitter daughterboard can be plugged into a Raspberry Pi Zero W with a header. This is a no solder solution (but the custom case top will not fit). Shown below is the daughterboard permanently soldered to the Raspberry Pi Zero W, reducing the vertical clearance. This allows a custom lid with holes cut out for the infrared LEDs and label to be snapped on to the top. The red bottom is the standard Raspberry Pi Zero case bottom with cutouts for power, USB, and HDMI ports on the side.

Gauge Data Transmitter in Raspberry Pi Zero case

pic of Gauge Data Transmitter