crycode-de / ioBroker.ds18b20

ioBroker adapter for DS18B20 1-wire temperature sensors
MIT License
6 stars 8 forks source link

Is the DS9490R USB to 1-Wire Adapter supported? #88

Closed Videonisse closed 2 years ago

Videonisse commented 2 years ago

Is it a requirement to use the GPIO pins on Raspberry Pi to use this Adapter, or does it work using the Maxim DS9490R USB to 1-Wire Adapter as well?

https://eu.mouser.com/ProductDetail/Maxim-Integrated/DS9490R

crycode-de commented 2 years ago

No it's not a hard requirement to use the GPIO pins. Any 1-wire bus master which is supported by the linux kernel will do the job. :-)

Since the DS9490R uses internally a DS2490 chip and there is a kernel module ds2490 it should work. You may need to load the kernel module by running sudo modprobe ds2490 and then a bus master should appear in /sys/bus/w1/.

Videonisse commented 2 years ago

Okey, I will then instead use a RaspPi and your remote client. I like the simplicity of your Adapter. I have it now installed. However, I can't locate the ".env" file. Where should I find it?

"After that you have to edit the created .env file and fill in at least the host and the encryption key."

Videonisse commented 2 years ago

I temporarily got it working setting the values in the console and manually starting the client from the /home/pi Folder

Command used: ADAPTER_KEY=[myKey] ADAPTER_HOST=[iobrokerHostName] SYSTEM_ID=RaspPi node ds18b20-remote-client.js

But first I actually tried creating my own .env file, but I can't get it working. Is the file name or path wrong?

File: /home/pi/ds18b20-remote-client.env

ADAPTER_HOST=[iobrokerHostName] 
ADAPTER_KEY=[myKey] 
SYSTEM_ID=RaspPi
crycode-de commented 2 years ago

If you run the script remote-client-setup.js it should create the following files in your current working directory:

common.js
ds18b20-remote-client.js
.env
iobroker-ds18b20-remote.service
logger.js

I would recommend to download and run the setup script in an extra directory, e.g. /home/pi/ds18b20-remote/. This will prevent conflicts with other software. The file have to be named .env without anything in front of the dot like /home/pi/ds18b20-remote/.env.

The default .env file looks like:

# Settings for the ioBroker.ds18b20 remote client

# Unique ID for this remote system
SYSTEM_ID=my-remote

# IP or hostname of the ioBroker host running the adapter
ADAPTER_HOST=

# Port from the adapter config
ADAPTER_PORT=1820

# Encryption key from the adapter config
ADAPTER_KEY=

# Enable debug log output
#DEBUG=1

# System path of the 1-wire devices
#W1_DEVICES_PATH=/sys/bus/w1/devices
Videonisse commented 2 years ago

Thanks for a great Adapter, everything works fine now!

I deleted all old files and created the suggested subfolder and run the installation. Unfortunately, the .env is not visible. But I can open and edit it with "nano .env". See below from the console. Why is the file hidden? (It's Raspberry OS/Debian v5.10.63)

On my first try, I was not in my home folder but in the root folder. As the next step, I tested from the home folder. From the instruction in the adapter configuration, it's not obvious where it should be installed. I thought the script handled this. Maybe you can add some text to the instructions about first manually creating the "ds18b20-remote" folder in the users home folder?

From Console:

pi@raspberrypi:~/ds18b20-remote $ node remote-client-setup.js
- ioBroker.ds18b20 remote client -

Basic setup done.

Please adjust the settings in the .env file.

To manually start the client just run:
  node ds18b20-remote-client.js

To setup the SystemD service, please run:
  sudo cp iobroker-ds18b20-remote.service /etc/systemd/system/iobroker-ds18b20-remote.service
  sudo systemctl daemon-reload
  sudo systemctl enable iobroker-ds18b20-remote.service
  sudo systemctl start iobroker-ds18b20-remote.service

pi@raspberrypi:~/ds18b20-remote $ ls
common.js  ds18b20-remote-client.js  iobroker-ds18b20-remote.service  logger.js  remote-client-setup.js

List all files including hidden:

pi@raspberrypi:~/ds18b20-remote $ ls -l -a
total 56
drwxr-xr-x 2 pi pi  4096 Nov 22 13:42 .
drwxr-xr-x 4 pi pi  4096 Nov 22 13:30 ..
-rw-r--r-- 1 pi pi  1055 Nov 22 13:32 common.js
-rw-r--r-- 1 pi pi 10399 Nov 22 13:32 ds18b20-remote-client.js
-rw-r--r-- 1 pi pi   482 Nov 22 13:38 .env
-rw-r--r-- 1 pi pi   334 Nov 22 13:32 iobroker-ds18b20-remote.service
-rw-r--r-- 1 pi pi   568 Nov 22 13:32 logger.js
-rw-r--r-- 1 pi pi 18064 Nov 22 13:31 remote-client-setup.js
crycode-de commented 2 years ago

Why is the file hidden?

Files/dirs starting with a dot are always hidden files/dirs on Linux.

From the instruction in the adapter configuration, it's not obvious where it should be installed.

In general it doesn't matter where you install the client but it's better to use an own directory for this to avoid conflicts with other software.

I've added the directory creation to the instructions on the admin page in the new version 1.4.2.