Skip to content

Tutorials

Matej Sychra edited this page Mar 22, 2018 · 11 revisions

Installing THiNXLib for NodeJS

Raspberry Pi

Seeking contributors here.

  1. Update package repositories:
cd / && apt-get update
  1. Install dependencies (you may keep your nodejs of use any tutorial regarding nodejs installation):
apt-get -y install unzip nodejs npm git
  1. Download sources:
git clone https://github.com/suculent/thinx-firmware-js.git
  1. Enter directory:
cd /thinx-firmware-js/
  1. Install dependencies:
npm install .
  1. Run THiNX Client:
node index.js
  1. Add following lines to /etc/rc.local to start THiNX client on boot (adjust path to fit yours):
cd /root/thinx-firmware-js && node index.js > /var/log/thinx.log &

Onion Omega 2+

  • USB Swap recommended.
  1. Connect to your Onion Omega 2+ using Terminal (the web console is missing Paste function).

  2. Enable LEDE repositories for OPKG by uncommenting reboot_packages in /etc/opkg/distfeeds.conf:

sudo nano /etc/opkg/distfeeds.conf
  1. Update OPKG repositories:
opkg update
  1. Install dependencies:
opkg install unzip nodejs npm git git-http ca-bundle
  1. Download sources:
git clone https://github.com/suculent/thinx-firmware-js.git
  1. Enter directory:
cd thinx-firmware-js/
  1. Disable MQTT's readable stream as it is not supported on this HW:
export READABLE_STREAM="disable"
  1. Install dependencies:
npm install .

If it fails due to memory reasons, just try again...

  1. Run THiNX Client:
node index.js
  1. Add following lines to /etc/rc.local to start THiNX client on boot:
export READABLE_STREAM="disable"
cd /root/thinx-firmware-js && node index.js > /var/log/thinx.log &
Clone this wiki locally