Hi Scott,
That is an awesome project. I use a lot of Ubiquity gear, and they have a non standard 24V PoE. Would the circuitry still work with 24V instead of 48V?
Bas
Hi Scott,
That is an awesome project. I use a lot of Ubiquity gear, and they have a non standard 24V PoE. Would the circuitry still work with 24V instead of 48V?
Bas
@Maximilian-Gerhardt Awesome! Thank you so much for putting this together!
Hello,
I'm rewriting some code that reads an I2C current sensor. In my rewrite I run into a segfault on an i2c write. The code in question is:
def pecmac():
"""
Support for the Control Everything current sensor. Code has been tested with the 70A/3 channel model
:return:
"""
logging.debug('...... i2c create')
i2c = onionI2C.OnionI2C(0x01)
#set the verbosity
logging.debug('...... i2c set verbosity')
i2c.setVerbosity(0x01)
command2 = [
0x6A,
0x02,
0x00,
0x00,
0x00,
0x00,
0xFE,
]
logging.debug('...... i2c command2')
i2c.writeBytes(0x2A, 0x92, command2)
The first time I run this code, all is well. But on the second run (after a 60s sleep inside the loop) I end up with a segfault.
The output I get (with the actual data collection output as well is:
20180203 21:31:41 Detected our hostname as [OMEGA-F6BB]
20180203 21:31:41 Creating database connection
20180203 21:31:41 .. Done
20180203 21:31:41 Reading sensor data
20180203 21:31:41 .. Reading data from sensor PECMAC
20180203 21:31:41 ...... i2c create
20180203 21:31:41 ...... i2c command2
20180203 21:31:42 ...... i2c readbytes
20180203 21:31:42 Type of Sensor: 4 | Maximum Current : 70A | No. of Channels: 3
20180203 21:31:42 Channel no: 1 | Current Value: 0.376A
20180203 21:31:42 Channel no: 2 | Current Value: 0.000A
20180203 21:31:42 Channel no: 3 | Current Value: 0.000A
[{'Timestamp': 1517722302698L, 'Sensor': 'pecmac', 'Value': 0.376, 'Measurement': 'ch1_current'}, {'Timestamp': 1517722302698L, 'Sensor': 'pecmac', 'Value': 0.0, 'Measurement': 'ch2_current'}, {'Timestamp': 1517722302698L, 'Sensor': 'pecmac', 'Value': 0.0, 'Measurement': 'ch3_current'}]
20180203 21:31:42 Processing the sensor data
20180203 21:31:42 .. Sending data to UBIDOTS
20180203 21:31:42 .... Checking if Ubidots is Online
20180203 21:31:43 .. Submitting data to Ubidots
20180203 21:31:43 {"ch1_current": {"timestamp": 1517722302698, "value": 0.376}}
20180203 21:31:44 {"ch2_current": {"timestamp": 1517722302698, "value": 0.0}}
20180203 21:31:44 {"ch3_current": {"timestamp": 1517722302698, "value": 0.0}}
20180203 21:32:44 .. Reading data from sensor PECMAC
20180203 21:32:44 ...... i2c create
20180203 21:32:44 ...... i2c command2
Segmentation fault
Logread shows:
Sat Feb 3 21:32:44 2018 kern.info kernel: [ 1251.955047] do_page_fault(): sending SIGSEGV to python for invalid write access to 00000000
Sat Feb 3 21:32:44 2018 kern.info kernel: [ 1251.963673] epc = 77ce6864 in libc.so[77cbe000+92000]
Sat Feb 3 21:32:44 2018 kern.info kernel: [ 1251.968855] ra = 779eac69 in libonioni2c.so[779ea000+11000]
Please note this is with some extra kernel modules to deal with I2C issues as per https://community.onion.io/topic/2312/i2c-detect-slave-method
tx
Bas
Hi,
An update, received the Onion shields and they worked without issues. Working with ControlEverything on their unit
Tx for the advice all
Bas
@ccs-hello said in Ethernet weirdness (no link with several switch):
You really should contact ControlEverything to ask them to perform a thorough test
(compatibility with many Ethernet switches) on that module they sold.
BTW, ask them to test using an Omega2. Omega1 supplies 2.5V on the transmitter side C.T., while
Omega2 does not (N.C. on that 2.5Vout pin.) They also use different Ethernet PHY internally.
Hi,
I had asked them to do that, and they replied they did test. But asked them to doublecheck it is indeed an Omega2
TX!
Bas
And GRRRRRRRRRRRRRR, same issue with the Trendnet.
Hi Luz,
My dayjob is in IT (with infra structure mgmt as my background) so deal with network issues fairly regularly. This one is curious since I tried:
There is 100% correlation to the switches used, any other variable can be changed without changing the result. The same switches have no issues establishing a link with a wide variety of other equipment.
Failed speed/duplex negotiations, poor speed as result of poor cable, etc etc, all fairly common. Don't think I have ever seen something like this.
Amazon just delivered me a cheap trendnet 5V power switch that people have used in IOT projects. I really hope that works
Might end up ordering one of the Onion shields to test
TX!
Bas
P.s, that must be an interesting deployment you have!
Hi,
Unless I missed something, the last Roadmap was up to July 2016. Is there any updates on what is in the pipeline. New modules in the works, software/firmware updates planned, etc
Tx
Bas
@ccs-hello Hi, the fact that it works with one switch without issues suggests (I think) that the hardware side of things is OK? I suspect there is something in the auto negotiation (Speed/Duplex) that fails
Bas
Hi,
Running into some rather curious issues. I have an ethernet expansion dock from ControlEverything (I actually have two, so tested with other one as well).
I found that the Omega is very picky in what it will built a link with:
The TP Link is the one I hope to use. Very low power and using 5V so great for combining with the 5V for the omega.
Firmware fully up to date.
Google has not turned up anything useful. All suggestions welcome!
Bas
Hi Maximillian,
There is an issue with the Python code that causes reads to not return correct results (http://community.onion.io/topic/2347/issues-with-controleverything-ad7999/6). ControlEverything recommended to try the C code.
I'll give your fix'ed up code a try tonight!
Tx
Bas
Hi,
Added the ability to compile on the Omega+ following the blog posts from a while ago. The code is from:
https://github.com/ControlEverythingCommunity/AD7999/blob/master/C/AD7999_4Channel.c
The compile fails with:
gcc AD7999_4Channel.c -o AD7999
AD7999_4Channel.c: In function 'main':
AD7999_4Channel.c:30:2: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]
write(file, config, 1);
^
AD7999_4Channel.c:31:2: warning: implicit declaration of function 'sleep' [-Wimplicit-function-declaration]
sleep(1);
^
AD7999_4Channel.c:36:5: warning: implicit declaration of function 'read' [-Wimplicit-function-declaration]
if(read(file, data, 2) != 2)
^
AD7999_4Channel.c:51:7: error: redefinition of 'config'
char config[1] = {0x20};
^
AD7999_4Channel.c:29:7: note: previous definition of 'config' was here
char config[1] = {0x10};
^
AD7999_4Channel.c:57:7: error: redefinition of 'data'
char data[2]={0};
^
AD7999_4Channel.c:35:7: note: previous definition of 'data' was here
char data[2]={0};
^
AD7999_4Channel.c:73:7: error: redefinition of 'config'
char config[1] = {0x40};
^
AD7999_4Channel.c:51:7: note: previous definition of 'config' was here
char config[1] = {0x20};
^
AD7999_4Channel.c:79:7: error: redefinition of 'data'
char data[2]={0};
^
AD7999_4Channel.c:57:7: note: previous definition of 'data' was here
char data[2]={0};
^
AD7999_4Channel.c:95:7: error: redefinition of 'config'
char config[1] = {0x80};
^
AD7999_4Channel.c:73:7: note: previous definition of 'config' was here
char config[1] = {0x40};
^
AD7999_4Channel.c:101:7: error: redefinition of 'data'
char data[2]={0};
^
AD7999_4Channel.c:79:7: note: previous definition of 'data' was here
char data[2]={0};
No experience at all with C, so no clue what is happening there. Any hints/tips welcome
Bas
My first finding: the COntrolEverything AD7999 does not work with the provided Python code Reading are not reliable. Will see if I can get the C version cross compiled
Hello,
I've been trying to get a Control Everything I2C A/D to work (AD7999) and it seems that for some reason the Python code is not returning reliable results (same board is fine on other small boards like Arduino).
I want to see if I can compile the C code provided by ControlEverything.
The wiki has some info on how to cross compile the whole package, can anybody point me in the right direction to just compile a single binary?
TX!
Bas
I put the whole code in a loop to let it run continuously. With nothing connected, the most common result I get is 16. Don't understand what the divide by 16 (2 bytes?) does. But big coincidence that is my most common reading?
If I put 2x 1.5V cell on, the reading only goes up to 33 or so
Bas
@Anil-bhaskar said in Issues with ControlEverything AD7999:
You will need to put some delay in between channel read. it updates adc values in only one register for all channels. so you will need to add some delay in between channel read and channel setup.
Hi,
I had already moved that up to 2 seconds since I noticed the Python code has 0.5s while the C code had 1s. It made no difference. I also don't think that explains the > 0 reading when there is nothing connected.
Weirdly, the behaviour is not consistent. The unit has been powered for hours now, and testing a battery has no effect on the report values
Bas
Hi Anil,
It's your video I saw that showed me what to expect (zero reading). I don't think I can compile on the Onion Omega without a lot of extra work.
I also noticed that when I measure the 1.5V battery, ALL channels will jump up?
Bas
Hi,
I'll try here first Let me know if the ControlEverything (now NCD) would be a better place.
I'm trying to build a low power datalogger for my Solar System. There is currently two voltages I'd like to monitor:
I ordered both a Network+I2C shield and an AD7999 (4 port) from ControlEverything.
Downloaded the python code and it runs OK, but I get non-zero values if I read with nothing connected (Vin(1) and GND tied together result in same). If I measure a 1.5V battery I get no different reading.
Does anybody have experience with this sensor?
TX!
Bas
Hi Matt,
Looking to do something similar, in my case I just want to monitor two voltages in my system:
I ordered an AD7999 A/D converter from control everything. My board has 4 ports, but I think they sell A/D converters with more ports. Don't know if you can use multiple of the same, since the I2C address I think is hardcoded.
Just getting started with my project
Bas
@Chris-Stratton said in 48V DC-DC converter [if to off-topic, admin pls remove]:
Do you want to monitor it or derive power from it, or both?
They are somewhat different problems - power supplies may hide moderate variations in input voltage, while just measuring voltage could be as simple as a divider made with high value resistors (possibly a few in series) and maybe a clamp as backup input protection.
Hi Chris,
I should have been more clear. The way I wrote it is confusing. I'm wanting to use a Omega2 /w AD converter to measure cells of the battery bank. The input to the AD will be done using a divider circuit.
My other problem is to power the Omega2 directly from that same battery bank as efficiently as possible. It's typically not recommended to use power from one of the 12V cells in the battery bank (unbalance), otherwise I could have used any cheap car adapter.
@WereCatf @Ken-Conrad
Awesome, thank you very much for these suggestions!!
Bas