For the ones having problems with the stable build (Version 2.1.1), always getting "mysgw: !TSM:INIT:TSP FAIL":
Seems there is a bug, you have to install "development" (Version 2.2.0)
Maybe someone adds an note on top of the tutorial, so others won´t also spend hours in searching for the problem on their Pi/Hardware.
Best posts made by Inso
-
RE: 💬 Building a Raspberry Pi Gateway
-
RE: A few noob questions
Thank you very much for your answer
@mfalkvidd said in A few noob questions:
There is no "connection" to sensors really. Sensors send messages whenever they are programmed to. The gateway forwards those messages to the chosen output (serial, ethernet , mqtt, etc). The format of the output is called "serial protocol" (because it originated from serial but the same protocol is used for ethernet, ...). The serial protocol is described at https://www.mysensors.org/download/serial_api_20
The log parser can be useful to get details on what the log is saying.
Very helpful, thank you
In your case, the node is asking the controller for a sensor node id. The gateway logs this "ask" message and forwards it to the output. But there is no reply from the controller. Have you added the gateway in Domoticz? If so, could you post your settings from the Domoticz hardware tab, the Domoticz log and the configure command you used for the raspi gateway?
2017-11-07 14:27:53.024 Domoticz V3.8153 (c)2012-2017 GizMoCuz 2017-11-07 14:27:53.025 Build Hash: 494fff7, Date: 2017-07-30 12:19:41 2017-11-07 14:27:53.026 Startup Path: /home/pi/domoticz/ 2017-11-07 14:27:54.028 PluginSystem: Started, Python version '3.5.3'. 2017-11-07 14:27:54.046 Active notification Subsystems: gcm, http (2/12) 2017-11-07 14:27:54.082 WebServer(HTTP) started on address: :: with port 8080 2017-11-07 14:27:54.100 WebServer(SSL) started on address: :: with port 443 2017-11-07 14:27:54.101 Proxymanager started. 2017-11-07 14:27:54.102 Starting shared server on: :::6144 2017-11-07 14:27:54.102 TCPServer: shared server started... 2017-11-07 14:27:54.103 RxQueue: queue worker started... 2017-11-07 14:27:56.197 EventSystem: reset all events... 2017-11-07 14:27:56.211 EventSystem: reset all device statuses... 2017-11-07 14:27:56.365 Python EventSystem: Module not found - Trying to initialize. 2017-11-07 14:27:56.366 Python EventSystem: Initalizing event module. 2017-11-07 14:27:56.367 EventSystem: Started 2017-11-07 14:27:56.529 PluginSystem: Entering work loop. 2017-11-07 14:27:57.196 MySensors: trying to connect to: 192.168.178.66:5003 2017-11-07 14:27:58.197 Error: MySensors: Network is unreachable 2017-11-07 14:27:58.197 Error: TCP: Error: Network is unreachable 2017-11-07 14:27:58.197 TCP: Reconnecting in 30 seconds... 2017-11-07 14:28:08.706 Incoming connection from: 192.168.178.37 2017-11-07 14:28:48.762 TCP: Reconnecting... 2017-11-07 14:28:48.762 MySensors: connected to: 192.168.178.66:5003 2017-11-07 14:28:49.762 MySensors: Gateway Ready... 2017-11-07 14:28:49.763 MySensors: Gateway Version: 2.2.0-rc.1 2017-11-07 14:28:50.763 MySensors: Gateway Version: 2.2.0-rc.1
./configure --my-gateway=ethernet --my-port=5003
Raspi is 192.168.178.66, running Domotics (standart ports) and MySensors gateway. It´s a test OS, all fresh installations, up to date. Domotics is not connected to my smart home atm to avoid any problems. All added is the MS-gateway.
Sensor is a motion sensor at the Arduino Uno.The log parser and the serial protocol are the main sources. But if you haven't already, read the getting started guide. Reading that will give you the background needed to understand how things fit together.
It is more the understanding of how sensor reading and sending data to the gateway is handled. In case of the BH1750 I have code which won´t need a libary, it´s very effective, very small. As I plan to combine sensors, less code would be fine to let a nano handle as much as possible. The links you provided should be very helpful setting up my own code after everything runs stable.
There seems to be a lot of html code in that library. There shouldn't be any html code in a library. Where did you download it from and how did you download it? Maybe you accidentally saved the github html page instead of saving the (raw) library file?
Argh, possible, as there was no zip archive I just right-clicked and saved from Github. I will try copy / paste instead^^.Was my DL -.-Have you seen the instructions and the example sketch at https://www.mysensors.org/build/light-bh1750 ? They are intended to provide all you need to get the sensor working, but we may have failed.
I copied 1:1, assume my fault with downloading the libary causes the problem.Compiling works nowI hope this helps. If you have further questions, just ask (but do read the instructions I linked first, they are intended to bring people up to speed as easily and quickly as possible so hopefully they'll save you some time)
I will definitely read through, already read the "getting started" section, will continue with the protocol wiki.
Btw, I just wanted to test if the problem of communicaton could be on the hardware side. I stopped the gateway on the RPI, and installed RF24 stuff from "http://tmrh20.github.io/RF24Installer/RPi/install.sh". Also used this before i found MySensors, to test the RPi/Arduino. With the getting started script, and RPi set to respond, I was not able to get a clean connection. The RPi was not able to send. The OS is, as I said, a fresh, updated install, only MS-gateway and Domotics are installed. I suspected the Rpi to cause the problem, switched the SD-card to the one with my running Domotics, installed also from "http://tmrh20.github.io/RF24Installer/RPi/install.sh" - and the Rpi was perfectly answering. Exact same hardware, only OS was switched. Maybe the problem is on the OS itself, If the information of Domotics do not give you a hint whats going wrong, I will reinstall the OS / MS / Domotics again..Reinstall also did not solve the problem. -
RE: 💬 Building a Raspberry Pi Gateway
@gohan ah okay wasn´t aware of it, as the dev channel worked I assumed the bug at MySensors.
However, would be awesome if there were a little hint in the tutorial. Took plenty of time to find out it was an software incompability -
RE: A few noob questions
@mfalkvidd
Finally it works, thank you very much for your fast and detailed help!
If someone else has the same problem : I exchanged the capacitor (had two old ones without number on it, now 47uf best China quality :D) which solved the problem. Seems with the old ones the voltage collapsed before sending all data, so ping worked, communication didn't. I btw need the capacitor also to get usable lux values from my bh1750, without its always the maximum lux value. -
RE: 💬 Building a Raspberry Pi Gateway
@mirodin
make install before testing did the trick, now it is 2.3.0 .
Was just going step by step through tutorial, there it´s make -> test -> make install. Didn´t realized it would use old parts if it´s not first install@gohan
thought stop, disable and remove the service would be enough to ensure the service is completely "uninstalled" - could you give me a hint what I´ve missed?