As much as I like the EmonTH, for me they are simply too expensive for general deployment round the house, so I have been after a cheaper alternative for a while.
Whilst they are likely to not be as reliable (in reading data terms) or accurate as an EmonTH (the temperature does oscillate), they work sufficiently well to be used to manage room temperatures especially when the readings are fed through a filter.
I’m using this PiW Zero to also do some presence detection using Bluetooth and the 2 seem to sit happily alongside each other.
Of course I then publish the data through MQTT and pull it into EmonCMS
Good solution - well done for finding that!
One problem with my installation though.
I have a Raspberry Pi 3 Model B Rev 1.2 running Raspbian GNU/Linux 8 (jessie) with EMONCMS + Node.red.
My Xiamoi temperature / humidity device is paired (using bluetoothctl | scan; then pair ).
Pi shows device as paired using bluetoothctl | paired-devices.
Added “node-red-contrib-xiaomi-ble” version 1.2.3 using node-red “Manage Palette” and simple node-red flow: inject 1 minute timestamp into a Xiamoi BLE node (configured with ) which when deployed, “node-red-contrib-xiaomi-ble” node shows “searching” then (after timeout?) shows “not found” and node-red debug tab reports “Device not found among []”
Running bluetoothctl shows:
continually alternating at ~5 second intervals
hciconfig shows "UP RUNNING", "RX..." and "TX ..." errors:0
Tried lots of things but still refuses to work.
Exactly the same as above on a pi-zero running “Raspbian GNU/Linux 9 (stretch)” works ok.
Any thoughts?
(sorry if this is a bit off topic)
Problem solved with…
“sudo setcap cap_net_raw+eip $(eval readlink -f which node)”
…but only when I “un-paired” the device. Seems pairing was interfering somehow.
Many thanks for your help.
Already got one Xiaomi Mijia, but installing node-red-contrib-xiaomi-ble on the “manage Palette”, after log in again in node-red, it disappears. Can you describe step by step what you did, so i can see what i am doing wrong? Even folowing the instruction i couldn’t get it working. For what i could find now, its related to node-gyp is not compatible with something on the node-red, but i would like to know what was you procedures if you don’t mind.
I expect if you check the logs you will find an error stating the node.
Not really. I tried to remember what I did but it was a world of fiddling that included installing a node from here (https://github.com/jrobeson/node-bluetooth-hci-socket/) - I think it depends on your nodejs version. Check out that nodes help page and delve into the dependencies as there are a number of other things you need to do to the system to make it work such as a setcap command.
A word of warning, IIRC, EmonPis disable bluetooth on a Pi so it can use the UART. Am I remembering that correctly @TrystanLea@glyn.hudson?
Already got it working and did blocked emoncms.
Had to reformat a new image on my SD card. Couldn’t access the emonpi.
The part of the the flow had helped me a lot on that problem.
I notice after a few hours of receiving data from xiaomi and resend it to emoncms on emonpi, i start to see errors, like emonpilcd stop working ( exited)or it freezes my emonpi, leaving me unable to login. Curious is i still receiving other (non xiaomi) feed values on android app.
If we receive the data from xiaomi sensor and don’t correct de data
before send it to emoncms, it mucks up EmonCMS. My english is not the best but i understood that it messes with emoncms, making some problems.
What happened to me was without correction, i start to see system frozens, sometimes i am unable to access login page or emonpi lcd freeze and can’t change it by pressing lcd buton.
Since i had SSH disabled, my solution was to change sd card by another to preserve the logs on it.
All of that started just as i start to use the xiaomi sensor.
My question is: should i send the feeds data to emoncms.org and if i do that, could exist the possibility to mess with the server or should i avoid do that? I am curently not using emoncms.org because of that.
Hey, no apologies needed! You are spending your time helping me and my english is not the best too.
After some “changes” (downgraded node version to 8.15.1 on my node-red installation to avoid install the “Bluetooth hci fix” (npm install https://github.com/jrobeson/node-bluetooth-hci-socket/#fix-builds-for-node-10), i didn’t have any problems yet (2 days fully working).
So, that could possibly be the reason to the issues.
just want to make sure if that happens, since i will send the feeds values to my account on emoncms.org, i need to be sure that NULL won’t freeze the server, which could affect all other users.
No the Nulls just seem to sometimes affect the data view, not the actually running of the server. I suspect the problems with the server was caused by the reading of the sensors locally.