Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
system_administration:manual_installation:3_mysensors [2019/12/29 20:29]
franzunix [d-diot images above or equal to 1.3]
system_administration:manual_installation:3_mysensors [2020/07/26 18:33] (current)
franzunix [Start and stop MySensors]
Line 6: Line 6:
 The main advantage of the dual radio setup is that you can use both type of sensors and actuators, on the basis of your needs. [[https://​forum.mysensors.org/​topic/​1723/​which-is-better-rfm69-or-nrf24l01|Here]] is an interesting discussion about the pros and cons of each radio type.  The main advantage of the dual radio setup is that you can use both type of sensors and actuators, on the basis of your needs. [[https://​forum.mysensors.org/​topic/​1723/​which-is-better-rfm69-or-nrf24l01|Here]] is an interesting discussion about the pros and cons of each radio type. 
  
 +====== d-diot images v.1.3 and below  ======
 ===== Source code  ===== ===== Source code  =====
  
Line 32: Line 33:
 </​cli>​ </​cli>​
  
-==== d-diot ​images above or equal to 1.3 ====+==== d-diot ​image v.1.3 ====
  
 In the d-diot images above or equal to version 1.3 the master branch is used. The default MySensors gateways are compiled for the Raspberry Pi 4, but the binary for the Raspberry pi 3 are stored in a separated folder. In the d-diot images above or equal to version 1.3 the master branch is used. The default MySensors gateways are compiled for the Raspberry Pi 4, but the binary for the Raspberry pi 3 are stored in a separated folder.
Line 258: Line 259:
 pi@d-diot:~ $ sudo nohup /​home/​pi/​MySensors/​nrf24/​bin/​./​mysgw-nrf24 >/​dev/​null 2>&1 & pi@d-diot:~ $ sudo nohup /​home/​pi/​MySensors/​nrf24/​bin/​./​mysgw-nrf24 >/​dev/​null 2>&1 &
 </​cli>​ </​cli>​
 +
 +====== d-diot images v.1.4 and above  ======
 +
 +Download source code from master branch.
 +<cli>
 +pi@d-diot:~ $ cd ~
 +pi@d-diot:~ $ git clone https://​github.com/​mysensors/​MySensors.git --branch master ​
 +</​cli>​
 +
 +To configure the MySensors ethernet gateway for the RFM69 (868 Mhz) radio module, run the following commands:
 +<cli>
 +pi@d-diot:~ $ cd /​home/​pi/​MySensors
 +pi@d-diot:​~/​MySensors $ ./configure --my-gateway=ethernet --my-port=5003 --my-transport=rfm69 --my-rfm69-frequency=868 --my-is-rfm69hw --spi-driver=SPIDEV --spi-spidev-device=/​dev/​spidev0.0 ​ --my-leds-err-pin=16 --my-leds-rx-pin=11 --my-leds-tx-pin=13 --my-signing=software --my-signing-debug --my-signing-request-signatures --my-signing-weak_security --my-config-file=/​etc/​mysensors.conf
 +</​cli>​
 +If you have a RFM69 radio module with a different frequency (433 or 915 Mhz), change the parameter "​--my-rfm69-frequency=868"​ accordingly.
 +
 +Please note that the gateway is compiled with the flag "​--my-signing-weak_security",​ so you can use both, signed and unsigned nodes. If you wont also to encrypt the communication between the nodes and the gateway add "​--my-rfm69-encryption-enabled",​ but this requires that all node uses an encrypted connection.
 +
 +A more detailed discussion on how to secure your MySensors network is [[https://​www.mysensors.org/​about/​signing|here]],​ and the list of the configure parameters is [[https://​www.mysensors.org/​apidocs/​group__RaspberryPiGateway.html|here]].
 +
 +Compile the source code:
 +<cli>
 +pi@d-diot:​~/​MySensors $ make
 +</​cli>​
 +If something goes wrong during the compilation,​ you can revert back with:
 +<cli>
 +pi@d-diot:​~/​MySensors $ make cleanconfig
 +pi@d-diot:​~/​MySensors $ make clean
 +</​cli>​
 +
 +Start the gateway once to generate the config file.
 +<cli>
 +pi@d-diot:​~/​MySensors $ sudo ./​bin/​mysgw  ​
 +</​cli>​
 +Press CTRL+c to terminate the execution and edit the config file. 
 +<cli>
 +pi@d-diot:​~/​MySensors $ sudo nano /​etc/​mysensors.conf
 +</​cli>​
 +This is how the config file should be.
 +<file text /​etc/​mysensors.conf>​
 +# Logging
 +# Verbosity: debug,​info,​notice,​warn,​err
 +verbose=debug
 +
 +# Enable logging to a file.
 +log_file=0
 +# Log file path.
 +log_filepath=/​tmp/​mysgw.log
 +
 +# Enable logging to a named pipe.
 +# Use this option to view your gateway'​s log messages
 +# from the log_pipe_file defined bellow.
 +# To do so, run the following command on another terminal:
 +#   cat "​log_pipe_file"​
 +log_pipe=0
 +log_pipe_file=/​tmp/​mysgw.pipe
 +
 +# Enable logging to syslog.
 +syslog=0
 +
 +# EEPROM settings
 +eeprom_file=/​etc/​mysensors.eeprom
 +eeprom_size=1024
 +
 +# Software signing settings
 +# Note: The gateway must have been built with signing
 +#       ​support to use the options below.
 +#
 +# To generate a HMAC key run mysgw with: --gen-soft-hmac-key
 +# copy the new key in the line below and uncomment it.
 +soft_hmac_key=AD5FEE012A7C793950558BA97E974F5B85476584ED1E4AC77FDB9FB0DE72A04F
 +# To generate a serial key run mysgw with: --gen-soft-serial-key
 +# copy the new key in the line below and uncomment it.
 +soft_serial_key=C2B57D1215706E0F91
 +
 +# Encryption settings
 +# Note: The gateway must have been built with encryption
 +#       ​support to use the options below.
 +#
 +# To generate a AES key run mysgw with: --gen-aes-key
 +# copy the new key in the line below and uncomment it.
 +aes_key=26548DFDCF82E9DF33E7500E629D9C40
 +</​file> ​
 +
 +See the "# Software signing settings"​ section at the end of the config file: three default keys are present but you have to [[how_to:​mysensors:​generate_private_keys|generate your own keys]] to avoid security issues.
 +
 +Test the gateway. [[https://​www.mysensors.org/​build/​raspberry#​test|Here]] more information on how to read the output messages. ​  
 +<cli>
 +pi@d-diot:​~/​MySensors $ sudo ./​bin/​mysgw ​
 +</​cli>​
 +Press CTRL+c to terminate the execution.
 +
 +Install the compiled code
 +<cli>
 +pi@d-diot:​~/​MySensors $ sudo make install
 +</​cli>​
 +Press CTRL+c to terminate the execution.
 +
 +===== Autostart MySensors at boot =====
 +
 +Enable the system service
 +<cli>
 +pi@d-diot:~ $ sudo systemctl enable mysgw.service
 +</​cli>​
 +
 +
 +===== Start and stop MySensors =====
 +
 +To stop MySensors RFM69 gateway:
 +<cli>
 +pi@d-diot:~ $ sudo systemctl stop mysgw.service
 +</​cli>​
 +
 +To start MySensors RFM69 gateway:
 +<cli>
 +pi@d-diot:~ $ sudo systemctl start mysgw.service
 +</​cli>​
 +
  
 [<>] [<>]
  
  • system_administration/manual_installation/3_mysensors.1577651397.txt.gz
  • Last modified: 2019/12/29 20:29
  • by franzunix