Jump to content

Bottesford

Members
  • Gesamte Inhalte

    13
  • Benutzer seit

  • Letzter Besuch

Bottesford's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation in der Community

  1. Maybe this will help someone - I created a systemd unit file for auto starting my mqtt bindings for all my TF bricks. Create a file: nano /etc/systemd/system/tf_mqtt@.service [unit] Description=Tinkerforge MQTT %i [service] Type=simple StandardOutput=file:/var/log/tinkerforge_mqtt/tf_mqtt_%i.log ExecStart=/usr/bin/python3 /usr/local/bin/tinkerforge_mqtt --ipcon-host %i --broker-username mqtt --broker-password <password> --global-topic-prefix tf_mqtt_%i [install] WantedBy=multi-user.target To start I pass the ip address (I use fixed ips) of my brick into the command: sudo systemctl start tf_mqtt@192.168.2.150 sudo systemctl start tf_mqtt@192.168.2.151 etc. Then to start on boot: sudo systemctl enable tf_mqtt@192.168.2.150 Now I get all my sensor data under a topic: tf_mqtt_192.168.2.150/# I register my callbacks via a python app in AppDaemon within Home Assistant. This means I can keep all my sensor config (led status, multi touch sensitivity, etc.) together instead of in the init file.
  2. I'm using a number of different sensors and am finding some of them are reporting a lot of value changes. This is especially true of my humidity, air pressure and ambient light (v1) sensors. When combined with the MQTT proxy this is leading to a lot of data traffic - multiple times per second per sensor kind of thing. For air pressure the changes are usually around 0.01 mbar which I don't care about. Is it possible to only fire the callback when a rounded 0.1 (or whatever I choose) difference is seen? I don't want it to only callback when a value change is > 0.1 but instead when the 1st number after the decimal point changes. So if I see this: 1010.335 rounds to 1010.3 no callback 1010.348 rounds to 1010.3 no callback 1010.389 <-- rounds to 1010.4 to fire callback here. The humidity sensor is worse as it varies over 1% very frequently (see attachment). So far I've been moderating the data flow in my application but this doesn't solve the network traffic to the MQTT broker being very high. I feel that I should plug this before it hits the mqtt broker service but am open to suggestions!
  3. You were correct - it was a problem in the Mosquitto broker. For some reason (that I still don't know) it throws up some weird connection problems that I wasn't able to solve. So I've moved over to using the MQTT broker built into Home Assistant (which is what I'm trying to get working with TF sensors) and now your proxy is working correctly. Thanks for pointing me in the right direction!
  4. Yes both the BrickD and MQTT broker are running on the RPi. Both ports are both on the defaults - 4223 / 1883. I have tried the changing the python proxy file to use the following IP addresses: For Brickd host: localhost, 127.0.0.1, 192.168.2.151 (IP of the RPi), 192.168.2.150 (a different brick on via a wifi extension), 192.168.2.167 (an address that does not exist on the network). All of these make no difference to the error message I get. For MQTT broker: localhost, 127.0.0.1, 192.168.2.151 (IP of the RPi) - the error does not change. If I try 192.168.2.167 (an address that does not exist on the network) I get [Errno 113] No route to host. If I try 192.168.2.150 (the address of a TF brick on via a wifi extension) I get [Errno 111] Connection refused. MQTT broker is tested and working via two terminal windows on the Pi as well as connecting and publishing/receiving from my Windows desktop pc using mqtt-spy application. From the above I would say the MQTT broker part is working ok but the brickd connection is not working - to any of my bricks on my network (I have four). Given the stack trace is showing the IPConnection class I'd say it is definitely the brick connection that is failing. Any ideas? Totally stuck with this now.
  5. I'm looking to open up my sensor network to MQTT and am trying to get the proxy to work. I followed instructions to get it running on my Raspberry Pi inc the ones I found here: https://www.tinkerunity.org/forum/index.php/topic,3926.msg23435.html I've updated everything on the Pi - latest brickd, latest brickv, bindings, etc. But I'm getting this: Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 505, in run self.__target(*self.__args, **self.__kwargs) File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 2606, in _thread_main self.loop_forever(retry_first_connection=True) File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 1470, in loop_forever rc = self.loop(timeout, max_packets) File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 995, in loop rc = self.loop_read(max_packets) File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 1275, in loop_read return self._loop_rc_handle(rc) File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 1754, in _loop_rc_handle self.on_disconnect(self, self._userdata, rc) File "brick-mqtt-proxy.py", line 1168, in mqtt_on_disconnect self.ipcon.disconnect() File "/usr/local/lib/python2.7/dist-packages/tinkerforge/ip_connection.py", line 357, in disconnect raise Error(Error.NOT_CONNECTED, 'Not connected') Error: Not connected (- I know that the brick connected to the Pi is working - the sensors are in regular use and I can connect with the brick viewer. Even if I explicitly set the IP address (or choose other bricks on my network) I get the same result. It seems to make no difference what host I set - same result. It does seem to be the brick connection failing (rather than mosquito) but I don't know why. Any ideas? And a question - I have a number of bricks around the house mostly using the wifi extension. Is it possible to set the proxy up to service them all? Or do I need to run one proxy per brick?
  6. Thanks but I'm getting : System.MissingMethodException : Method not found: 'Void Tinkerforge.BrickletMotionDetector.SetStatusLEDConfig(Byte)'. I call it like this: bricklet.SetStatusLEDConfig(BrickletMotionDetector.STATUS_LED_CONFIG_OFF); I'm using the latest bindings (2.1.12.0) and I have fully updated all my Bricks & Bricklets as well as Brickd and viewer.
  7. When will the updated c# DLL be ready so I can use this in my code? My bricklet was updated but I still can't use the new method yet. Thanks.
  8. I broke one of my master brick pins only last week so I'm 100% behind the new connectors. Given you are saying it'll all be completely compatible and far superior connectors then it's a no brainer - switch to the new connectors.
  9. I was wondering if there was a way to disable any of the status LEDs found on the various bricks & bricklets? I'm using the wifi extension + motion detector bricklet which between them have 3 bright LEDs. These are useful in testing but for the motion detector especially it is undesirable having the bright blue light on every time someone walks in the room. I intend to set it up in a bedroom (for automatic switch on of lighting at suitable times) so a bright LED in the middle of the night isn't nice. Also I'm considering the power use of all these LEDs running all the time - it would be better to disable them when not testing the system. Is the any plan to add some a method 'SetStatusLightsOff' or similar?
  10. The RS485 has only 3 pins thought so where would the +5v line go? Directly to the master brick via the USB connector? This makes sense but just want to be sure.
  11. Thank you both for your very helpful replies (and in English - I do live in Berlin but my Deutsch is not yet good enough to discuss this sort of thing!). I have ordered a Raspberry Pi to connect the indoor station to, so for indoor & pressure information I think I'm ok. For the outdoor station I will get: - Temperature bricklet - Humidity bricklet - Colour bricklet (for sunshine hours calculation - although I'm not sure how well this will work) - IO-4 bricklet for rain/wind sensors. - Master brick I don't have a rain gauge any more as it failed along with the rest of my old weather station. So I need to get one although I am not sure which one to get. The Davis one is quite expensive - any other recommendations? Same for the wind gauge... As for connecting the sensors to the indoor station/Pi I can think of two ideas: - Have the master brick stack inside and run cables out to the sensors. This would mean at least 4 cables to pass through a window from inside to outside which would not be easy. I don't know how long the cables to sensors can be either. - Have a master brick outside with the sensors connected to it. Then I need to connect this back to the indoor station (or directly to the Pi). Is the RS485 bricklet suitable? It looks good for long range communication I'd still need power outside too and I guess you can't run power via the RS485. I'd like to avoid battery power as I think it would run down too quickly. You say a large solar panel would be needed which still might be an option. It depends how much power the components are likely to need given this setup. Thanks again for your help!
  12. I've just got the weather station kit and love it - so much possibility here! I notice the 'chip temperature' value is 1-2c my usual indoor thermometer - is there an accuracy problem here? I got the kit as I needed to replace my existing weather station but as things stand I can't do that yet.. Firstly I need to run it outdoors with a solar or battery source of energy (the weather isn't inside the house after all!). Is a solar or battery bricklet etc. on the way? I noticed a discussion in the Deutsch forum on this matter but wasn't sure... The ambient light bricklet only responds up to 1000 lux which is way below sunlight (ten times that value maybe). Is the colour bricklet more suitable for measuring sunlight hours? Or is maybe a UV detection bricklet on the way? I'd like to add a rain gauge & maybe a wind gauge too. I could do rain measurement with an existing rain gauge using a digital input that generates a signal for every 1mm of rain. For wind that might be more difficult. Anyone else done this? Of course all of this will need to be waterproof too - is something like that being developed or shall I try to build something myself?
×
×
  • Neu erstellen...