I have successfully installed and run InfluxDB on an RPi 4 64bit in accordance with the Smart Home v1.4 book. The InfluxDB interface works properly through an SSH remote on my Windows desktop.
When I tried to create the influx config file with the command ‘influx config create … ….’ I received a ‘command not found’ error.
I searched on the internet for solutions but could not find anything useful. I edited the $PATH variable to include InfluxDB directories but this did not help. A printout of the status command gives the following:
pi@raspberrypi4B-1:~ $ sudo service influxdb status
● influxdb.service – InfluxDB is an open-source, distributed, time series database
Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; preset: enabled)
Active: active (running) since Fri 2024-08-23 20:23:40 EDT; 20min ago
Docs: https://docs.influxdata.com/influxdb/
Process: 1291 ExecStart=/usr/lib/influxdb/scripts/influxd-systemd-start.sh (code=exited, status=0/SUCCESS)
Main PID: 1301 (influxd)
Tasks: 14 (limit: 3910)
CPU: 7.981s
CGroup: /system.slice/influxdb.service
├─1301 /usr/bin/influxd
├─1399 /usr/bin/dbus-daemon –syslog –fork –print-pid 4 –print-address 6 –session
├─1400 /usr/bin/dbus-daemon –syslog –fork –print-pid 4 –print-address 6 –session
├─1415 /usr/bin/dbus-daemon –syslog –fork –print-pid 4 –print-address 6 –session
└─1430 /usr/bin/dbus-daemon –syslog –fork –print-pid 4 –print-address 6 –session
Aug 23 20:23:40 raspberrypi4B-1 influxd-systemd-start.sh[1301]: ts=2024-08-24T00:23:40.195040Z lvl=info msg=”Opened shard” log_id=0rCS7FgW000 service=storage-engine service=store op_name=tsdb_open index_version=tsi1 path=/var/lib/influx>
Aug 23 20:23:40 raspberrypi4B-1 influxd-systemd-start.sh[1301]: ts=2024-08-24T00:23:40.199693Z lvl=info msg=”Open store (end)” log_id=0rCS7FgW000 service=storage-engine service=store op_name=tsdb_open op_event=end op_elapsed=854.876ms
Aug 23 20:23:40 raspberrypi4B-1 influxd-systemd-start.sh[1301]: ts=2024-08-24T00:23:40.199904Z lvl=info msg=”Starting retention policy enforcement service” log_id=0rCS7FgW000 service=retention check_interval=30m
Aug 23 20:23:40 raspberrypi4B-1 influxd-systemd-start.sh[1301]: ts=2024-08-24T00:23:40.199946Z lvl=info msg=”Starting precreation service” log_id=0rCS7FgW000 service=shard-precreation check_interval=10m advance_period=30m
Aug 23 20:23:40 raspberrypi4B-1 influxd-systemd-start.sh[1301]: ts=2024-08-24T00:23:40.211670Z lvl=info msg=”Starting query controller” log_id=0rCS7FgW000 service=storage-reads concurrency_quota=1024 initial_memory_bytes_quota_per_query>
Aug 23 20:23:40 raspberrypi4B-1 influxd-systemd-start.sh[1301]: ts=2024-08-24T00:23:40.239929Z lvl=info msg=”Configuring InfluxQL statement executor (zeros indicate unlimited).” log_id=0rCS7FgW000 max_select_point=0 max_select_series=0 >
Aug 23 20:23:40 raspberrypi4B-1 influxd-systemd-start.sh[1301]: ts=2024-08-24T00:23:40.323931Z lvl=info msg=Starting log_id=0rCS7FgW000 service=telemetry interval=8h
Aug 23 20:23:40 raspberrypi4B-1 influxd-systemd-start.sh[1301]: ts=2024-08-24T00:23:40.325399Z lvl=info msg=Listening log_id=0rCS7FgW000 service=tcp-listener transport=http addr=:8086 port=8086
Aug 23 20:23:40 raspberrypi4B-1 influxd-systemd-start.sh[1291]: InfluxDB started
Aug 23 20:23:40 raspberrypi4B-1 systemd[1]: Started influxdb.service – InfluxDB is an open-source, distributed, time series database.
I did not deviate from the Smart Home book and installation went as described in the book. In case it was a PATH error I edited the path.
My PATH environment is now:
pi@raspberrypi4B-1:~ $ printenv PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/var/lib/
but the error is still occuring. The ‘influx’ command is not recognized by the OS as shown here:
pi@raspberrypi4B-1:~ $ influx
-bash: influx: command not found
My board is an RPi 4B with 64-bit Bookworm. Any suggestions?
I was following the book, and when I got to creating the config file I received the error. So it was at the command:
‘influx config create –config-name influx-config –host-url… …’ on page 241.
But I tried just running ‘influx’ without arguments and I still get the error. As you can see from running the status command as documented above, the influxdb service is installed and running. So it’s really a mystery why the OS can’t find it. There should be no conflicts with other installed software because I installed a fresh copy of Bookworm with desktop, and then just node-red, mosquitto, and influxdb.
Hi again.
Can you access the InfluxDB dashboard when you go to the Pi IP address followed by :8086?
I have no idea why it doesn’t find the influx DB command…
Did you install it globally or in a virtual environment?
Regards,
Sara
Yes, the InfluxDB dashboard loads fine. Everything seems normal except that I can’t run an influx command from the OS.
I installed InfluxDB directly on my RPi 4 through an SSH on my Windows desktop. And like I stated before, I did a clean install of 64-bit Bookworm on my RPi 4. No other software except Node-RED and Mosquitto, as I was following the Smart Home book. The InfluxDB status command shows the influx service as installed and active, so I’m wondering how is it possible that the OS returns “command not found”. Very puzzling.
Here’s proof that the influxd service is running:
pi@raspberrypi4B-1:~ $ systemctl list-units –type=service –state=running
UNIT LOAD ACTIVE SUB DESCRIPTION
accounts-daemon.service loaded active running Accounts Service
avahi-daemon.service loaded active running Avahi mDNS/DNS-SD Stack
bluetooth.service loaded active running Bluetooth service
colord.service loaded active running Manage, Install and Generate Color Profiles
cron.service loaded active running Regular background program processing daemon
cups-browsed.service loaded active running Make remote CUPS printers available locally
cups.service loaded active running CUPS Scheduler
dbus.service loaded active running D-Bus System Message Bus
getty@tty1.service loaded active running Getty on tty1
influxdb.service loaded active running InfluxDB is an open-source, distributed, time series database
… … plus others… …
UPDATE: I tried installing InfluxDB on another raspberry pi 4B running a clean install of Debian 11 (Bullseye 64-bit), using the commands on the InfluxDB website for an install on Ubuntu/Debian arm64. Same results – influx command not found.
Not sure how to proceed. Can anyone tell me exactly what they did on their system to install influxdb and to successfully run the influx command?
Problem solved.
Here’s what I was missing. By following the Smart Home v1.4 book I was to understand that the influx CLI was installed when InfluxDB was installed (see snippet from the book, which is the top of page 239, see figure). The book states “It should be automatically installed when you install InfluxDB”. However, that was not the case for me. The book takes you through creating tokens (pages 237-238) but does not discuss installing the CLI, as is done inside of the InfluxDB program (see figure). Selecting “Load Data” -> “Sources” -> “File Upload” -> “Influx CLI” takes you to the “overview” page from which you then select “Install Dependencies”. Under “Install Dependencies, select “Linux”. After copying and applying the commands on this page I successfully installed the ‘influx’ command on my Raspberry Pi.
This procedure is skipped in the book because it’s assumed that the CLI was installed, but should probably be added, unless I missed seeing something that was already stated in the book.
I used the following commands from the InfluxDB CLI install page:
Unpackage the downloaded package
Install the downloaded InfluxDB client package. Adjust filenames, paths, and utilities as needed.
wget https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.3.0-linux-arm64.tar.gz
Unpackage the downloaded package
Install the downloaded InfluxDB client package. Adjust filenames, paths, and utilities as needed.
tar xvzf path/to/influxdb2-client-2.3.0-linux-arm64.tar.gz
Place the executable in your $PATH (optional)
If you do not move the influx binary into your $PATH, prefix the executable .\ to run it in place.
sudo cp influxdb2-client-2.3.0-linux-arm64/influx /usr/local/bin/
Hi.
Thanks for your feedback.
At the time of the most recent update of the eBook, I tested that section and CLI was automatically installed.
It seems something has changed in the installation procedure.
I’ll have to check that out and include new instructions on how to install the CLI.
Thanks for providing the solution.
Meanwhile, I see that you’re following version 1.3 (outdated). Page 239 doesn’t correspond to that content in version 1.4.
To include pictures, you need to upload them to google drive or dropbox or imgur and then share a link to the file.
Thanks for your patience.
Regards,
Sara
Correction. It is page 241 of version 1.4. I was looking at the pdf program’s page numbering, not the book’s.
page 241 of version 1.4
https://drive.google.com/file/d/1-3NpkJkpQHM77cMMFzIIrwIWNKczATVF/view?usp=drive_link
InfluxDB CLI installation screen
https://drive.google.com/file/d/1AcerH0P4P7xW8i5Idr3A0oFORjBPexN1/view?usp=drive_link
Hi.
Thank you so much for sharing.
I’ll test that and update the eBook.
Regards,
Sara
Hello Bruce,
Sorry for taking so long to get back to you, but I was only able to re-test all the instructions from our eBook today. We started with a fresh installation of Raspberry Pi OS 64-bit released on 2024-07-04 (port of Debian Bookworm). Then, we followed the exact instructions described in Smart Home eBook version 1.4.
I can confirm that CLI is automatically installed by default with those instructions and there’s no further configurarion required. I’m not really sure what could be missing during your set up…
- Question #1 – Did all the commands from page 231 run succesffully? After this command:
sudo apt-get update && sudo apt-get install influxdb2
If you look at page 232 it should say “Unpacking influxdb-cli and setting up influxdb” during the influxdb installation.
- Question #2 – Which Influxdb version do you have installed?
Can you run this command? (REPLACE WITH YOUR RPI IP ADDRESS)
curl -skL -I 'http://192.168.1.69:8086/ping'
It should return the following:
HTTP/1.1 204 No Content Vary: Accept-Encoding X-Influxdb-Build: OSS X-Influxdb-Version: v2.7.10 Date: Mon, 02 Sep 2024 12:16:32 GMT
Do you have Influxdb-Version: v2.7.10 installed?
Influx CLI is running after a re-install of InfluxDB, after a fresh install of Bookworm 64-bit.
I don’t know what the problem was, but InfluxDB installs correctly per the book’s instructions.
Obviously, I screwed-up the installation somehow. My apologies for wasting your time.
I’m working my way through the Smart Home book and find it is well written & very informative and instructive – a great value!