home automation

If it doesn't relate to Debian, but you still want to share it, please do it here

Re: home automation

Postby Stian1979 » 2020-03-01 07:07

arzgi wrote:There is libmodbus in Debian repos, don't know other than name of it.

You need anyhow some I/O card, I don't know if linux kernel supports any, or some microcontroller to drive electricity on. PC can not do it on its own.

To read values from net, you can use Debian, there are many options, but all I know require at least some programming.

Dont need linux suport for the IO card if it uses modbus. Modbus tcp uses standard cat cable.
So I just need an ethermet port and a IO module with a rj45 port that suports modbus ower ethernet.
So instal the librarys for modbus and learn to write modbus comands from phyton .
For me the hardware part is the easy part as I been in the automation field as service tech, but newer been this deep into the software part. Used to work with preconfigured systems.
Posts: 313
Joined: 2007-07-29 14:57

Re: home automation

Postby arzgi » 2020-03-01 13:10

Thanks for clarifying. My knowing of modbus is from one course studied many years ago :o

One possible solution, requires some handwork, but the idea is that you can make a bash script after tuning.
Code: Select all
 # apt install wget html2text

Make some dir to your /home or to /tmp, change to it.

wget was easy to use years ago, but now most web pages use JavaScript, to tackle this, you need these options
Code: Select all
wget \
     --recursive \
     --no-clobber \
     --page-requisites \
     --html-extension \
     --convert-links \
     --restrict-file-names=windows \
     --domains example.com \

Note the two last lines, includes web address and domain, which you have to change. This could also made to script, which could take web address as an option, I think you don't need many pages.

Locate the *.html file wget created, in this case to /tmp || ~/http://www.example.com dir. Just for example, i use here file.html

Code: Select all
htlm2text -o some_file  file.html

Now you need to extract the needed info from some_file. Use grep, cut, whatever standard tools.Rest depends what you want do with that info, save it to file or smth else.
Posts: 710
Joined: 2008-02-21 17:03
Location: Finland

Re: home automation

Postby arzgi » 2020-03-01 14:04

libmodbus5 is a C-library, you need to compile two short programs, one to pull the relay, other to reset.


Seems quite understandable. You can call C-programs from bash script.
Posts: 710
Joined: 2008-02-21 17:03
Location: Finland


Return to Offtopic

Who is online

Users browsing this forum: No registered users and 14 guests