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

Cannot find any scripts in the services directory of each container #227

Open
Simon3tiw opened this issue Jan 28, 2021 · 1 comment
Open

Comments

@Simon3tiw
Copy link

Simon3tiw commented Jan 28, 2021

Hi Guys,

I'm trying to set up this IOT stack on my RPI4. I have already several containers running but need to do some modifications.
For example I want to add a database in influxdb and the doc explains me to add it in the ./services/influxdb/influx.env file.
Unfortunately I cannot locate any files in the services/influxdb folder except the build_settings.yml file. The terminal.sh script is also missing. Other container services are missing those files/ scripts as well.

The RPI4 has the latest Debian lite installed and I'm connecting over SSH.

Hopefully someone knows the explanation for this.

Thank you in advance.
Br, Simon

@Paraphraser
Copy link
Contributor

Please see This Project Is Dormant.

IOTstack (this repo and the active one) implicitly assume a Raspberry Pi (3 or 4) running Raspbian ("Raspberry Pi OS") with a default login user of "pi", user ID 1000, where "~" expands to "/home/pi". That's not to say other arrangements won't work. It's just that that particular combination gets a lot more testing than anything else so, the further you get away from that, the more your mileage may vary, as it were.

It sounds like things are a bit hosed. How far have you gone and what can you afford to lose?

Here's what I would do. If your stack is running, take it down.

$ cd ~/IOTstack
$ docker-compose down

Then, move your current folder out of the way:

$ cd
$ mv IOTstack IOTstack.off

Check out the current repo:

$ git clone https://github.com/SensorsIot/IOTstack.git ~/IOTstack

Be aware that you can't re-use your existing docker-compose.yml. The main problem is in networks (see Issue 245 if you want a detailed discussion).

Tip:

  • If you're doing this headless via ssh (which is what you said), make your terminal window as big as you can.

Run the menu and build your stack:

$ cd ~/IOTstack
$ ./menu.sh

Is Node-Red part of your build? If yes, one reasonably common mistake is selecting Node-Red in the menu but not hitting the right-arrow at that point to select the nodes you want to install. If you avoid that mistake, it mostly works OK.

AFTER you have run the menu to choose your containers but BEFORE you bring up the stack for the first time, think about whether there is anything in ~/IOTstack.off/volumes that you want to preserve. If there is, you can move it. You'll need to pay attention to permissions. Something like:

$ sudo cp -a ~/IOTstack.off/volumes/nodered ~/IOTstack

generally gets the job done. The -a preserves permissions.

Next, think about anything you might need to recover from the old docker-compose.yml. But please be careful and don't replace whole chunks. Line by line is better.

THEN bring up the stack:

$ cd ~/IOTstack
$ docker-compose up -d

One major difference between what you've experienced to date (gcgarner/IOTstack) and the current version of SensorsIot/IOTstack concerns environment files. Those used to live in subfolders of ~/IOTstack/services but now all of the environment variables are inline in docker-compose.yml.

When it comes to Influx, you might find these two gists helpful:

Both of those explain how to create a new empty database. The second one also covers fiddling with environment variables. Just make sure you read the "definition" at the top and understand it is telling you that environment variables can be in EITHER place. What it actually MEANS is that, if you were running old-menu (gcgarner-like) then your environment variables would be in an environment file; under new-menu, they're in docker-compose.yml. As you'll be running new-menu (what you get by default), there won't be any environment file for InfluxDB. Clear?

If a fresh checkout of the current repo doesn't help then I'd probably start to question the Debian decision.

One final point. You wrote:

I want to add a database in influxdb and the doc explains me to add it in the ./services/influxdb/influx.env

I don't know what doco you are talking about but it's somewhere between misleading and wrong (or you might be misunderstanding what it is saying). You do not create databases with environment variables. After you've read the gists, you'll understand that it helps to have this alias in place:

$ alias influx='docker exec -it influxdb influx -precision=rfc3339'

after which creating a database named, say, "example" is:

$ influx
> create database example
> exit
$

The kinds of things you do with environment variables are to enable authentication, set a default username and password for the database administrator (it applies when the influx command above is typed - nothing else), and define a database for something like Telegraf to log data over UDP. If it is this that you are talking about, the environment variable:

INFLUXDB_UDP_DATABASE=udp

means you have to create the database named "udp" (ie replace "example" with "udp" in the above). Then, once that database exists, you can change:

INFLUXDB_UDP_ENABLED=false

to be "true", then:

$ docker-compose up -d influxdb

will cause docker-compose to notice the change to the environment variable, recreate the influxdb container, the influxd process will see that INFLUXDB_UDP_ENABLED is true, and will turn on UDP support, writing anything it receives to whatever is on the right hand side of INFLUXDB_UDP_DATABASE. I hope that all makes sense.

Please try to remember to close your issue here on gcgarner.

If you have any more questions, either open a new issue on SensorsIot/IOTstack or join the Discord channel (there's a link near the bottom of the main page).

Hope this helps.

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

No branches or pull requests

2 participants