piBeacon: presence monitoring plugin discussions
Re: piBeacon: presence monitoring plugin discussions
fixed G.timezones in line 1288, piBeaconUtils. in next release,
the stopBLE not found can be ignored. It is not an error, it is exists it is a msg from other processes, ==> will suppress msg
so do you still get
05-17:09:48 beaconloop execbeaconloop L:982 Lv:50 in Line 973 has error=timed out.. sock.recv error, likely time out ?
Karl
the stopBLE not found can be ignored. It is not an error, it is exists it is a msg from other processes, ==> will suppress msg
so do you still get
05-17:09:48 beaconloop execbeaconloop L:982 Lv:50 in Line 973 has error=timed out.. sock.recv error, likely time out ?
Karl
Re: piBeacon: presence monitoring plugin discussions
@GlennNZ:
published new version .346 with fixes for timezone, NTP install and removed the stopBLE msg
Karl
published new version .346 with fixes for timezone, NTP install and removed the stopBLE msg
Karl
Re: piBeacon: presence monitoring plugin discussions
Thanks Karl! Thats fixed those..kw123 wrote:@GlennNZ:
published new version .346 with fixes for timezone, NTP install and removed the stopBLE msg
Karl
Working my way through a few other bits and pieces,
the INPUT-ADC-4x12/16bit-one-channel-i2c-ADS1x15 device
Have a few that has now updated (see it has had considerable code changes)
Seems a few issues:
- status: from device always blank
- state: always 0
- INPUT_raw: 255.99 - always??
Even for different devices on different rpis?
Below is logging from rpis with everything line with 255.99 - as can see across multiple (well I have three) sensors connected to two different rpis, and quite different devices always give the same answer...
Code: Select all
2020-04-06 17:11:13 sensor input pi: 5; data {u'ADS1x15': {u'1036561108': {u'INPUT': 255.99}, u'752082303': {u'INPUT': 255.99}}}
2020-04-06 17:11:13 updateINPUT: piBeacon Level Sensor 185 rpi; sensor: ADS1x15; upState: INPUT_0; inputState: INPUT; data: {u'INPUT': 255.99}
2020-04-06 17:11:13 updateINPUT: Pibeacon - test watertank; sensor: ADS1x15; upState: INPUT_0; inputState: INPUT; data: {u'INPUT': 255.99}
2020-04-06 17:11:13 pi# 5 1036561108 {u'187287881': {u'last_MessageFromRpi': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': '2020-04-06 17:11:13'}}, u'752082303': {u'INPUT': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': u'255.99'}, u'INPUT_raw': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': 255.99}}, u'1036561108': {u'INPUT': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': u'-38.003329533'}, u'INPUT_raw': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': 255.99}}}
2020-04-06 17:11:13 pi# 5 752082303 {u'187287881': {u'last_MessageFromRpi': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': '2020-04-06 17:11:13'}}, u'752082303': {u'INPUT': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': u'255.99'}, u'INPUT_raw': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': 255.99}}}
2020-04-06 17:11:40 sensor input pi: 2; data {u'ADS1x15': {u'1874635667': {u'INPUT': 255.99}, u'1980283685': {u'INPUT': 255.99}}}
2020-04-06 17:11:40 updateINPUT: Pibeacon Pool pH copy; sensor: ADS1x15; upState: INPUT_1; inputState: INPUT; data: {u'INPUT': 255.99}
2020-04-06 17:11:40 updateINPUT: Pibeacon Pool ORP; sensor: ADS1x15; upState: INPUT_0; inputState: INPUT; data: {u'INPUT': 255.99}
2020-04-06 17:11:40 pi# 2 1874635667 {u'1874635667': {u'INPUT': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': u'3.2944625'}, u'INPUT_raw': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': 255.99}}, u'1980283685': {u'INPUT': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': u'2.16322564'}, u'INPUT_raw': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': 255.99}}, u'1991519083': {u'last_MessageFromRpi': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': '2020-04-06 17:11:40'}}}
2020-04-06 17:11:40 pi# 2 1980283685 {u'1980283685': {u'INPUT': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': u'2.16322564'}, u'INPUT_raw': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': 255.99}}, u'1991519083': {u'last_MessageFromRpi': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': '2020-04-06 17:11:40'}}}
2020-04-06 17:12:15 sensor input pi: 5; data {u'ADS1x15': {u'1036561108': {u'INPUT': 255.99}, u'752082303': {u'INPUT': 255.99}}}
2020-04-06 17:12:15 updateINPUT: piBeacon Level Sensor 185 rpi; sensor: ADS1x15; upState: INPUT_0; inputState: INPUT; data: {u'INPUT': 255.99}
2020-04-06 17:12:15 updateINPUT: Pibeacon - test watertank; sensor: ADS1x15; upState: INPUT_0; inputState: INPUT; data: {u'INPUT': 255.99}
2020-04-06 17:12:15 pi# 5 1036561108 {u'187287881': {u'last_MessageFromRpi': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': '2020-04-06 17:12:15'}}, u'752082303': {u'INPUT': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': u'255.99'}, u'INPUT_raw': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': 255.99}}, u'1036561108': {u'INPUT': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': u'-38.003329533'}, u'INPUT_raw': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': 255.99}}}
2020-04-06 17:12:15 pi# 5 752082303 {u'187287881': {u'last_MessageFromRpi': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': '2020-04-06 17:12:15'}}, u'752082303': {u'INPUT': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': u'255.99'}, u'INPUT_raw': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': 255.99}}}Code: Select all
2020-04-06 17:14:43 pi# 2 1874635667 {u'1874635667': {u'INPUT': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': u'3.2944625'}, u'INPUT_raw': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': 255.99}}, u'1980283685': {u'INPUT': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': u'2.16322564'}, u'INPUT_raw': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': 255.99}}, u'1991519083': {u'last_MessageFromRpi': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': '2020-04-06 17:14:43'}}}
2020-04-06 17:14:43 pi# 2 1980283685 {u'1980283685': {u'INPUT': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': u'2.16322564'}, u'INPUT_raw': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': 255.99}}, u'1991519083': {u'last_MessageFromRpi': {'decimalPlaces': '', 'force': False, 'uiValue': '', 'value': '2020-04-06 17:14:43'}}}rpi 5
Code: Select all
pi@raspberrypi:~/pibeacon/temp $ tail ADS1x15.dat
{
"1874635667": {
"INPUT": 255.99
},
"1980283685": {
"INPUT": 255.99
}Code: Select all
pi@raspberrypi:~/pibeacon/temp $ tail ADS1x15.dat
{
"1036561108": {
"INPUT": 255.99
},
"752082303": {
"INPUT": 255.99
}
}pi@raspberrypi:~/pibeacon/temp $ piBeacon: presence monitoring plugin discussions
mine works fine.
Could you share the setup
1. which hardware?
2. parameters for section:
i2cdetect -y 1
.. my config
With some of the hardware boards you need to be careful with ground. It is connected to the RPi ground make sure that your sensor connected to the board is floating.
Also if you could disconnect input from the ADC converter and just touch the input with your fingers, you should see some changes in value.
And do you have other inputs ie i2c conflicts?
AND THESE ADC are sensitive to over voltage > VDD = 3.3V !! they die
Karl
Could you share the setup
1. which hardware?
2. parameters for section:
Code: Select all
"sensors": {
"ADS1x15": {
"188809276": {
"gain": "6144",
"i2cAddress": "72", < -- this is decimal == 48 hex
"input": "0",
"logScale": "0",
"minSendDelta": "4",
"offset": "0",
"resModel": "16",
"sendToIndigoEvery": "60",
"sensorRefreshSecs": "2",
"useMuxChannel": "-1"
}
}, Code: Select all
i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- 4c -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@raspberrypi:~/pibeacon $
With some of the hardware boards you need to be careful with ground. It is connected to the RPi ground make sure that your sensor connected to the board is floating.
Also if you could disconnect input from the ADC converter and just touch the input with your fingers, you should see some changes in value.
And do you have other inputs ie i2c conflicts?
AND THESE ADC are sensitive to over voltage > VDD = 3.3V !! they die
Karl
Re: piBeacon: presence monitoring plugin discussions
kw123 wrote: Could you share the setup
1. which hardware?
2. parameters for section:
.. my config
With some of the hardware boards you need to be careful with ground. It is connected to the RPi ground make sure that your sensor connected to the board is floating.
Also if you could disconnect input from the ADC converter and just touch the input with your fingers, you should see some changes in value.
And do you have other inputs ie i2c conflicts?
Karl
Hi Karl,
Thousand apology's for the delay - I know how annoying it is to troubleshoot over gap of days. Few things going on in world/work and all!
These devices I haven't touched/rewired or looked at for a few years. They were working with the previous device definition - but updated then as you depreciated it.
Seems strange to me that both reading the same amount following this update.
rpi-2
Code: Select all
pi@raspberrypi:~ $ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@raspberrypi:~ $ Code: Select all
pi@raspberrypi:~/pibeacon/temp $ tail alive.ADS1x15
1586476061.47
pi@raspberrypi:~/pibeacon/temp $ tail ADS1x15.dat
{
"1874635667": {
"INPUT": 255.99
},
"1980283685": {
"INPUT": 255.99
}
}pi@raspberrypi:~/pibeacon/temp $ tail parameters
"eth0": {
"on": "off",
"useIP": "doNotUse"
},
"wlan0": {
"on": "on",
"useIP": "use"
}
}
}pi@raspberrypi:~/pibeacon/temp $ cd ..
pi@raspberrypi:~/pibeacon $ ls
actions.py displayDistance.py installLibs2.py mpu9255.py rc.local stepperc.py
ADS1x15.py displayfiles installLibs.done myBLEmac rc.local.default stepperDR.py
amg88xx.py display.inp installLibs.py myprogram.py rd200radon.py stepper.py
apds9960.py display.py interface.py neopixelClock.py receiveCommands.py temp
as3935.py doGPIOatStartup.py interfaces neopixel.inp renameMeTo_myoutput.py testLED.py
as726x.py doNotIgnore interfaces-adhoc neopixel.py renameMeTo_myprogram.py tmp006.py
autostart.forxwindows execcommands.current interfaces-DEFAULT nohup.out renameMeTo_mysensors.py tmp007.py
batteryLevelPosition execcommands.py interfaces-DEFAULT-clock offsetUUID rgbmatrix.so touchFile
beacon_ExistingHistory fastDown interfaces-DEFAULT-wifi onlyTheseMAC _rpi_ws281x.so ultrasoundDistance.py
beaconloop.py fonts interfaces-old OUTPUTgpio.py rsyslog upsV2.py
beacon_parameters getBeaconParameters.py ipAddress '<PageElemList type="vector"> 3.textClipping' setGPIO.py UUIDtoIphone
'beacon_parameters copy' h1106.py l3g4200.py parameters setmcp4725.py vcnl4010Distance.py
'beacon_parameters copy 2' hmc5883L.py launchpgm.py parameters-DEFAULT-clock setPCF8591dac.py vl503l0xDistance.py
BLEconnect.py hwclock.set.nohwclock lidar360.py parameters.startup setStepperMotor.py vl53l0x_python.so
BLEsensor.py ignoreMAC lsm303.py patterns setTEA5767.py vl6180xDistance.py
bme680.py ignoreUUID mag3110.py patterns-DEFAULT sgp30.py webserverINPUT.py
bno055.py images master.py patterns-DEFAULT-clock si7021.py webserverSTATUS.py
callbeacon.py ina219.py master.sh PCF8591.py signalDelta wifiInfo.json
ccs811.py ina3221.py masterStartAfterboot permanent.log simplei2csensors.py Wire18B20.py
checkForInclude-py2.py INPUTgpio.count max31865.py piBeaconGlobals.py smbus2.py wpa_supplicant.conf
checkForInclude-py3.py INPUTgpio.py mhzCO2.py piBeaconGlobals.pyc smbus2.pyc wpa_supplicant.conf-DEFAULT
checkVoltage.py INPUTpulse.count mlx90614.py piBeaconUtils.py soundfiles wpa_supplicant.conf-DEFAULT-clock
convert.py INPUTpulse.py mlx90640.py piBeaconUtils.pyc spiMCP3008.py wpa_supplicant.conf-old
copyToTemp.py INPUTRotarySwitchAbsolute.py moist.py playsound.py startmaster.sh wpa_supplicant.conf-temp
dhclient.conf-fast INPUTRotarySwitchIncremental.py moistureSensor.py pmairquality.py stepper2H.py
DHT.py INPUTtouch.py mpu6050.py rainSensorRG11.py stepper2.py
pi@raspberrypi:~/pibeacon $ Re: piBeacon: presence monitoring plugin discussions
I had the same problem with a broken chip. The value was constant 512
Also normally the i2c channels are 2 apart ( not 48 and 49) ... what other sensor do you have attached?
and for the parameter file do a
cat
not a
tail
need to see the section:
"sensors": {
"ADS1x15": {
...
}
in the parameters file
and the directory listing needs the date stamp:
ls -l
... just saw, you are NOT using the old device def?
In Indigo you need to delete and recreate with the new device type
Karl
ps.. and / or show the device edit screen shot
Also normally the i2c channels are 2 apart ( not 48 and 49) ... what other sensor do you have attached?
and for the parameter file do a
cat
not a
tail
need to see the section:
"sensors": {
"ADS1x15": {
...
}
in the parameters file
and the directory listing needs the date stamp:
ls -l
... just saw, you are NOT using the old device def?
In Indigo you need to delete and recreate with the new device type
Karl
ps.. and / or show the device edit screen shot
Re: piBeacon: presence monitoring plugin discussions
Thanks Karl
Using new device definition - didn't delete and recreate - but done so now and same 255.99 result for x2 devices, across x2 rpi's
Image of new device definition :

Adding rest..
Using new device definition - didn't delete and recreate - but done so now and same 255.99 result for x2 devices, across x2 rpi's
Code: Select all
"sensors": {
"ADS1x15": {
"1874635667": {
"format": "%1.2f",
"gain": "256",
"i2cAddress": "73",
"input": "0",
"logScale": "0",
"minSendDelta": "4",
"offset": "685.285",
"resModel": "16",
"sendToIndigoEvery": "60",
"sensorRefreshSecs": "1",
"useMuxChannel": "-1"
},
"1980283685": {
"format": "%1.2f",
"gain": "256",
"i2cAddress": "73",
"input": "0",
"logScale": "0",
"minSendDelta": "4",
"offset": "-2500",
"resModel": "16",
"sendToIndigoEvery": "60",
"sensorRefreshSecs": "1",
"useMuxChannel": "-1"
}
},
"INPUTgpio-1": {
"108500439": {
"INPUTS": [
{
"count": "off",
"gpio": "26",
"inpType": "high"
},
{},
{},
{}
],
"gpio": "26",
"inpType": "high",
"lowHighAs": "0",
"offset": "0"
},
"1354564053": {
"INPUTS": [
{
"count": "off",
"gpio": "20",
"inpType": "high"
},
{},
{},
{}
],
"gpio": "20",
"inpType": "high",
"lowHighAs": "1",
"offset": "0"
},
"1655035980": {
"INPUTS": [
{
"count": "off",
"gpio": "16",
"inpType": "high"
},
{},
{},
{}
],
"gpio": "16",
"inpType": "high",
"lowHighAs": "0",
"offset": "0"
},
"1992126480": {
"INPUTS": [
{
"count": "off",
"gpio": "19",
"inpType": "high"
},
{},
{},
{}
],
"gpio": "19",
"inpType": "high",
"lowHighAs": "0",
"offset": "0"
}
},
"i2cTMP102": {
"1737976775": {
"displayEnable": "1",
"i2cAddress": "72",
"offsetTemp": "0",
"useMuxChannel": "-1"
}
}
}, 
Adding rest..
Re: piBeacon: presence monitoring plugin discussions
gain = 16 for both (param= 256 == 16x) maxes out at 0.256 volt = 255.99 bits (rounding effect)
try gain = 1 ( param = 4096) and see what happens
Karl
the device edit section for that parameter:
try gain = 1 ( param = 4096) and see what happens
Karl
the device edit section for that parameter:
Code: Select all
<Field id="gain" type="menu" defaultValue="4096"> <Label>Gain:</Label>
<List>
<Option value="6144" >2/3 Gain : max=6.144V, 3mV/bit res only if V+ 6V.xV </Option>
<Option value="4096" >1 Gain : max=4.096V, 2mV/bit res default, goes to max 3.29V if V+=3.3V used</Option>
<Option value="2048" >2 Gain : max=2.048V, 1mV/bit res</Option>
<Option value="1024" >4 Gain : max=1.024V, 0.5mV/bit res</Option>
<Option value="512" >8 Gain : max=0.512V, 0.25mV/bit res</Option>
<Option value="256" >16 Gain : max=0.256V, 0.125mV/bit res</Option>
</List>
</Field>
Re: piBeacon: presence monitoring plugin discussions
Yah!
Thanks - thats it - at least they now all give different readings...
Has there been a change in how this affects the raw input, I am still testing but warying of time difference so posting now
These images are the old device definitions - where for WaterTank-Level sensor with these settings would expect a value of 800-900 with the gain set as below
(new definition ?same gain maxs out at 299?)


Thanks - thats it - at least they now all give different readings...
Has there been a change in how this affects the raw input, I am still testing but warying of time difference so posting now
These images are the old device definitions - where for WaterTank-Level sensor with these settings would expect a value of 800-900 with the gain set as below
(new definition ?same gain maxs out at 299?)


Re: piBeacon: presence monitoring plugin discussions
I need to check. But the gain settings should be the same
. May be the old was wrong. The new one is correct.
What are the actual voltages 800-900 mV?
Then yes the high gain will always result in max / overflow.
Karl.
Sent from my iPhone using Tapatalk
. May be the old was wrong. The new one is correct. What are the actual voltages 800-900 mV?
Then yes the high gain will always result in max / overflow.
Karl.
Sent from my iPhone using Tapatalk
Re: piBeacon: presence monitoring plugin discussions
Thanks
Yes voltages given with old device and x16 gain 858, 1049, & 1051 (from looking a old, production computer settings)
Just presumed more gain, better resolution when I was creating
New devices maxing out at 255.99 - explains the across device issues I was seeing.
Trouble is had created a graph of various readings for sensor, matched to watertank pressure levels which gave me cm of water in tank.
Will have to check whether same rules apply now with a different gain.
Thanks!
Glenn
Yes voltages given with old device and x16 gain 858, 1049, & 1051 (from looking a old, production computer settings)
Just presumed more gain, better resolution when I was creating
New devices maxing out at 255.99 - explains the across device issues I was seeing.
Trouble is had created a graph of various readings for sensor, matched to watertank pressure levels which gave me cm of water in tank.
Will have to check whether same rules apply now with a different gain.
Thanks!
Glenn
Re: piBeacon: presence monitoring plugin discussions
You can use offset and mult 1 2 to get the same values as before
Sent from my iPhone using Tapatalk
Sent from my iPhone using Tapatalk
Re: piBeacon: presence monitoring plugin discussions
Thanks Karl
Unfortunately used offset/multiple (as you'll see in device definitions) to covert the mV to CMS and unfortunately don't have the mV graph data that I collected at multiple water levels anymore.
Glenn
Unfortunately used offset/multiple (as you'll see in device definitions) to covert the mV to CMS and unfortunately don't have the mV graph data that I collected at multiple water levels anymore.
Glenn
Re: piBeacon: presence monitoring plugin discussions
here the resolution:
this was the old code:
in principle correct but gain was "256" , not 256.
and "256" > 6144 == True ( also "6144" > 6144 ==True)
hence g= 6144 ALWAYS
So your setting was: 2/3 Gain : max=6.144V, 3mV/bit
if you use that setting it should behave like before.
So no matter what you picked it was always gain 2/3 => 3mV / bit; 0..... 6.144V
Measuring 3mV /bit accuracy in a stable way over a longer wire is actually not trivial. So you actually did not loose a lot of accuracy.
>>> IF<<< the voltage is 800.900 mV you could set the gain to 4 and change the multiplier from 1 to 0.25 and offset to oldOffset *4 , that SHOULD work.
value = ( raw + offset )* mult
Karl
this was the old code:
Code: Select all
if sensors[sensor][devId]["gain"] != "" :
g=sensors[sensor][devId]["gain"]
if g>6144: g=6144
if g<256: g=256
if g%2!=0: g=6144
and "256" > 6144 == True ( also "6144" > 6144 ==True)
hence g= 6144 ALWAYS
So your setting was: 2/3 Gain : max=6.144V, 3mV/bit
if you use that setting it should behave like before.
So no matter what you picked it was always gain 2/3 => 3mV / bit; 0..... 6.144V
Measuring 3mV /bit accuracy in a stable way over a longer wire is actually not trivial. So you actually did not loose a lot of accuracy.
>>> IF<<< the voltage is 800.900 mV you could set the gain to 4 and change the multiplier from 1 to 0.25 and offset to oldOffset *4 , that SHOULD work.
value = ( raw + offset )* mult
Karl
Re: piBeacon: presence monitoring plugin discussions
Perfect thanks!
Enjoy your Easter!
Enjoy your Easter!