kizniche / Mycodo

An environmental monitoring and regulation system
http://kylegabriel.com/projects/
GNU General Public License v3.0
2.95k stars 495 forks source link

ADS1256 ADC Input addition #537

Closed SAM26K closed 5 years ago

SAM26K commented 5 years ago

Mycodo Issue Report:

Problem Description

Please list:

    sudo /etc/getch0.sh
    Above command calls the following command:
    sudo python ~/Desktop/ads1256code1/py-ads1256/read_volts_ch0.py

   read_volts_ch0.py contains the following python code:
   import ads1256       # import this lib                             

gain = 1             # ADC's Gain parameter
sps = 25             # ADC's SPS parameter

# Create the first list. It will receive ADC's absolute values
AllChannelValuesVolts = [0,0,0,0,0,0,0,0]       

# Create the second list. It will received absolute values converted to Volts
AllChannelValues = [0,0,0,0,0,0,0,0]        

# Initialize the ADC using the parameters
ads1256.start(str(gain),str(sps))  
#Fill the first list with all the ADC's absolute channel values
AllChannelValues = ads1256.read_all_channels()        
 for i in range(0, 8):
    # Fill the second list  with the voltage values
    AllChannelValuesVolts[i] = (((AllChannelValues[i] * 100) /167.0)/int(gain))/1000000.0   
#for i in range(0, 8):     
#    # Print all the absolute values
#    print AllChannelValues[i]              
# Print a new line
#print ("\n");                             
#for i in range(0, 8):     
    # Print all the Volts values converted from the absolute values
#    print AllChannelValuesVolts[i]
 print AllChannelValuesVolts[0]
# Stop the use of the ADC
ads1256.stop()  

Errors

Steps to Reproduce the issue:

How can this issue be reproduced?

  1. step 1
  2. step 2...
  3. etc

Additional Notes

Is there anything that should be added to make it easier to address this issue?

kizniche commented 5 years ago

What's "flaky"?

SAM26K commented 5 years ago

Sometimes most of the channels are reading reasonable values. Channels 6 and 7 are reading 0 when they should be 1.15 V. Sometimes some are all channels go to zero or some very low number. You can login and check it.

On Tue, Oct 16, 2018 at 7:18 PM Kyle Gabriel notifications@github.com wrote:

What's "flaky"?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-430465643, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjUoGjp4spwnu6BbatTssEUfpd1fiks5ulpN5gaJpZM4XBeMO .

kizniche commented 5 years ago

I never had access to the web UI. The login page loaded once, then it would continually time out after that.

SAM26K commented 5 years ago

See if it works now. I turned off the SSL requirements.

On Tue, Oct 16, 2018 at 7:51 PM Kyle Gabriel notifications@github.com wrote:

I never had access to the web UI. The login page loaded once, then it would continually time out after that.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-430471194, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjd4FhmM_OOpctMUaKPA7FCk3SHGMks5ulptJgaJpZM4XBeMO .

kizniche commented 5 years ago

Connection still times out. I updated your code and restarted your daemon. Let me know if that fixes the 0s.

SAM26K commented 5 years ago

Reading 2.9477, 3.0000, 2.5483, 2.7599, 2.7218, 0.0136, 0.0000, 0.0002. None are very close, I'll check the Comcast router and turn off the Norton AV. That might help with the UI problem.

On Tue, Oct 16, 2018 at 8:08 PM Kyle Gabriel notifications@github.com wrote:

Connection still times out. I updated your code and restarted your daemon. Let me know if that fixes the 0s.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-430473814, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjX0vQPi2SsgCZvoGBxJzJbmEfm0Lks5ulp81gaJpZM4XBeMO .

kizniche commented 5 years ago

I was just able to log in for the first time. What I immediately noticed is you have your sample rate (measurement every 3 seconds for each channel) waaay to fast. You can't possibly conduct all measurements before the next has to be performed. I would recommend no less than a 15 second Period per ADC input when attempting to measure all channels.

kizniche commented 5 years ago

I see you even have 2 ADC inputs set to a Period of 1 second. These Periods are probably the cause of your issues.

SAM26K commented 5 years ago

Try the UI again.

On Tue, Oct 16, 2018 at 8:13 PM John Baxter jbbart03@gmail.com wrote:

Reading 2.9477, 3.0000, 2.5483, 2.7599, 2.7218, 0.0136, 0.0000, 0.0002. None are very close, I'll check the Comcast router and turn off the Norton AV. That might help with the UI problem.

On Tue, Oct 16, 2018 at 8:08 PM Kyle Gabriel notifications@github.com wrote:

Connection still times out. I updated your code and restarted your daemon. Let me know if that fixes the 0s.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-430473814, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjX0vQPi2SsgCZvoGBxJzJbmEfm0Lks5ulp81gaJpZM4XBeMO .

kizniche commented 5 years ago

I was just able to log in for the first time.

This is indicating I was able to log in.

Reading 2.9477, 3.0000, 2.5483, 2.7599, 2.7218, 0.0136, 0.0000, 0.0002. None are very close,

I'm not sure what you mean by this. Are you insinuating they should be the same?

kizniche commented 5 years ago

Though, most of the time the connection times out. I've only been able to load 1 out of maybe 100 tries. It's too unreliable for me to continue trying to access it.

SAM26K commented 5 years ago

I'll try the slower update times. This is a fast a/d converter though. I turned off all the firewalls and disabled SSL. Is it still timing out?

On Tue, Oct 16, 2018 at 8:20 PM Kyle Gabriel notifications@github.com wrote:

Though, most of the time the connection times out. I've only been able to load 1 out of maybe 100 tries. It's too unreliable for me to continue trying to access it.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-430475847, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjRvn0y1WSSUK7RX-GdAUN6QLFuOSks5ulqIRgaJpZM4XBeMO .

kizniche commented 5 years ago

It looks like I can connect consistently now.

SAM26K commented 5 years ago

Great! I set all the refresh times in the data section to 15.

On Tue, Oct 16, 2018 at 8:27 PM Kyle Gabriel notifications@github.com wrote:

It looks like I can connect consistently now.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-430476771, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjVWEtWDiubpUdCs36X3dbv2PVbIdks5ulqOKgaJpZM4XBeMO .

kizniche commented 5 years ago

Voltages are looking stable on the graph.

kizniche commented 5 years ago

The current method of acquiring one ADC channel measurement per input is very inefficient. What #550 proposes in the first line item is to allow multiple channel measurements for a single input module. This would make all measurements have the same timestamp and show up in the same tooltip when hovering on graphs.

SAM26K commented 5 years ago

One thing I noticed is the default time stamp font is 1.5 and is accepted when the measurement control is saved. 1 works. Also, the voltage and units min max only take integers. Is that a limitation with the a/d board?

On Tue, Oct 16, 2018 at 8:35 PM John Baxter jbbart03@gmail.com wrote:

Great! I set all the refresh times in the data section to 15.

On Tue, Oct 16, 2018 at 8:27 PM Kyle Gabriel notifications@github.com wrote:

It looks like I can connect consistently now.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-430476771, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjVWEtWDiubpUdCs36X3dbv2PVbIdks5ulqOKgaJpZM4XBeMO .

SAM26K commented 5 years ago

Ch3, Ch6 and Ch7 are not right. The should all be less than about 2.1 V and Ch 6, 7 should be around 1 V.

On Tue, Oct 16, 2018 at 8:50 PM John Baxter jbbart03@gmail.com wrote:

One thing I noticed is the default time stamp font is 1.5 and is accepted when the measurement control is saved. 1 works. Also, the voltage and units min max only take integers. Is that a limitation with the a/d board?

On Tue, Oct 16, 2018 at 8:35 PM John Baxter jbbart03@gmail.com wrote:

Great! I set all the refresh times in the data section to 15.

On Tue, Oct 16, 2018 at 8:27 PM Kyle Gabriel notifications@github.com wrote:

It looks like I can connect consistently now.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-430476771, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjVWEtWDiubpUdCs36X3dbv2PVbIdks5ulqOKgaJpZM4XBeMO .

kizniche commented 5 years ago

only take integers

An unexpected side-effect of a previous update a few weeks ago. I'm surprised no one else has caught it until now.

kizniche commented 5 years ago

I just pushed a commit that fixes the inability to save float values. You can upgrade to the repo master if you don't want to wait for the next release to use the code.

kizniche commented 5 years ago

Ch3, Ch6 and Ch7 are not right. The should all be less than about 2.1 V and Ch 6, 7 should be around 1 V.

Do you have a meter or scope to verify the actual voltages?

kizniche commented 5 years ago

Also, switching the leads from a channel you think isn't operating properly with one that is should give you insight.

SAM26K commented 5 years ago

I checked it when I built everything using the example code in the folder ~/Desktop/ADS1256 from Waveshare. The program ads1256_test runs in a loop and displays all 8 channels with 6 decimal places. Those voltages are very accurate but I think its a different way of accessing the data as the single channel method.

On Tue, Oct 16, 2018 at 9:10 PM Kyle Gabriel notifications@github.com wrote:

Also, switching the leads from a channel you think isn't operating properly with one that is should give you insight.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-430483100, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjdBnB0BY87sC90EzwjpHXOoRlg5aks5ulq25gaJpZM4XBeMO .

kizniche commented 5 years ago

I'll test later. I'm out of time now.

SAM26K commented 5 years ago

Ok thanks for your help. Feel free to login and work on it whenever you want.

On Tue, Oct 16, 2018 at 9:24 PM Kyle Gabriel notifications@github.com wrote:

I'll test later. I'm out of time now.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-430485025, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjcBwLscp5kYME_SlHlGlD5DGs6pyks5ulrD6gaJpZM4XBeMO .

SAM26K commented 5 years ago

Hi Kyle, The voltage readouts are still not right. Ch5 reads way low (below 1V) when it should be about 1.6V. The other channels are all reading a little high. For some reason Ch5 is behaving differently than Ch0-4, One thing I was wondering is if one or more of the channels is configured for differential input? I'm using it wired for single ended on all the inputs, so the chip would have to be configured for single-ended to work right.

On Tue, Oct 16, 2018 at 9:25 PM John Baxter jbbart03@gmail.com wrote:

Ok thanks for your help. Feel free to login and work on it whenever you want.

On Tue, Oct 16, 2018 at 9:24 PM Kyle Gabriel notifications@github.com wrote:

I'll test later. I'm out of time now.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-430485025, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjcBwLscp5kYME_SlHlGlD5DGs6pyks5ulrD6gaJpZM4XBeMO .

SAM26K commented 5 years ago

Can you point me to the source code for the ads1256 source code modules? Thanks

On Thu, Oct 18, 2018 at 5:35 AM John Baxter jbbart03@gmail.com wrote:

Hi Kyle, The voltage readouts are still not right. Ch5 reads way low (below 1V) when it should be about 1.6V. The other channels are all reading a little high. For some reason Ch5 is behaving differently than Ch0-4, One thing I was wondering is if one or more of the channels is configured for differential input? I'm using it wired for single ended on all the inputs, so the chip would have to be configured for single-ended to work right.

On Tue, Oct 16, 2018 at 9:25 PM John Baxter jbbart03@gmail.com wrote:

Ok thanks for your help. Feel free to login and work on it whenever you want.

On Tue, Oct 16, 2018 at 9:24 PM Kyle Gabriel notifications@github.com wrote:

I'll test later. I'm out of time now.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-430485025, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjcBwLscp5kYME_SlHlGlD5DGs6pyks5ulrD6gaJpZM4XBeMO .

SAM26K commented 5 years ago

Ok I think it might be differential vs single ended. It looks like the code in Mycodo/mycodo/inputs/ads1256_input.py sets the channel modes on lines 73-84. What is "ADS1256_definitions"? Channel config is probably there. The neg input pins should all be set to AINCOM for single ended operation. At least I hope that's the problem.

On Thu, Oct 18, 2018 at 8:56 AM John Baxter jbbart03@gmail.com wrote:

Can you point me to the source code for the ads1256 source code modules? Thanks

On Thu, Oct 18, 2018 at 5:35 AM John Baxter jbbart03@gmail.com wrote:

Hi Kyle, The voltage readouts are still not right. Ch5 reads way low (below 1V) when it should be about 1.6V. The other channels are all reading a little high. For some reason Ch5 is behaving differently than Ch0-4, One thing I was wondering is if one or more of the channels is configured for differential input? I'm using it wired for single ended on all the inputs, so the chip would have to be configured for single-ended to work right.

On Tue, Oct 16, 2018 at 9:25 PM John Baxter jbbart03@gmail.com wrote:

Ok thanks for your help. Feel free to login and work on it whenever you want.

On Tue, Oct 16, 2018 at 9:24 PM Kyle Gabriel notifications@github.com wrote:

I'll test later. I'm out of time now.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-430485025, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjcBwLscp5kYME_SlHlGlD5DGs6pyks5ulrD6gaJpZM4XBeMO .

kizniche commented 5 years ago

The source is a forked PiPyADC repo I ported to python 3.

https://github.com/kizniche/PiPyADC-py3

SAM26K commented 5 years ago

So it looks like lines 25-43 in above file sets the channel mode? NEG_AINn needs to be set to AINCOM for n = 0-7 somehow.

On Thu, Oct 18, 2018 at 11:15 AM Kyle Gabriel notifications@github.com wrote:

The source is a forked PiPyADC repo I ported to python 3.

https://github.com/kizniche/PiPyADC-py3

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-431109357, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVja9Y9D_XTOHnEdjy2OP6I4xikyR0ks5umMVGgaJpZM4XBeMO .

SAM26K commented 5 years ago

I meant ADS1256_definitions.py

On Thu, Oct 18, 2018 at 11:44 AM John Baxter jbbart03@gmail.com wrote:

So it looks like lines 25-43 in above file sets the channel mode? NEG_AINn needs to be set to AINCOM for n = 0-7 somehow.

On Thu, Oct 18, 2018 at 11:15 AM Kyle Gabriel notifications@github.com wrote:

The source is a forked PiPyADC repo I ported to python 3.

https://github.com/kizniche/PiPyADC-py3

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-431109357, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVja9Y9D_XTOHnEdjy2OP6I4xikyR0ks5umMVGgaJpZM4XBeMO .

kizniche commented 5 years ago

I meant ADS1256_definitions.py

Look in the root directory of my repository I linked.

NEG_AINn needs to be set to AINCOM for n = 0-7 somehow.

I'm not familiar with this sensor. I haven't had a chance to read the datasheet. You're welcome to test code changes. Make sure you save, then restart the daemon for changes to take effect.

SAM26K commented 5 years ago

This may sound like a dumb question but where is ADS1256_definitions.py on the raspberry pi?

On Thu, Oct 18, 2018 at 11:54 AM Kyle Gabriel notifications@github.com wrote:

I meant ADS1256_definitions.py

Look in the root directory of my repository I linked.

NEG_AINn needs to be set to AINCOM for n = 0-7 somehow.

I'm not familiar with this sensor. I haven't had a chance to read the datasheet. You're welcome to test code changes. Make sure you save, then restart the daemon for changes to take effect.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-431121590, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjTss_POC31Xkm0NOBwiFNXRWh3XOks5umM5PgaJpZM4XBeMO .

kizniche commented 5 years ago

where is ADS1256_definitions.py on the raspberry pi?

You shouldn't edit this file, but it's located at ~/Mycodo/env/src/pipyadc-py3/ADS1256_definitions.py

SAM26K commented 5 years ago

Never mind I found it.

On Thu, Oct 18, 2018 at 11:59 AM John Baxter jbbart03@gmail.com wrote:

This may sound like a dumb question but where is ADS1256_definitions.py on the raspberry pi?

On Thu, Oct 18, 2018 at 11:54 AM Kyle Gabriel notifications@github.com wrote:

I meant ADS1256_definitions.py

Look in the root directory of my repository I linked.

NEG_AINn needs to be set to AINCOM for n = 0-7 somehow.

I'm not familiar with this sensor. I haven't had a chance to read the datasheet. You're welcome to test code changes. Make sure you save, then restart the daemon for changes to take effect.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-431121590, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjTss_POC31Xkm0NOBwiFNXRWh3XOks5umM5PgaJpZM4XBeMO .

SAM26K commented 5 years ago

Reading the ads1256 to figure out where the channel mode is set. Have seen it called scan_mode in other code. 0 sets it to single ended.

On Thu, Oct 18, 2018 at 12:15 PM Kyle Gabriel notifications@github.com wrote:

where is ADS1256_definitions.py on the raspberry pi?

You shouldn't edit this file, but it's located at ~/Mycodo/env/src/pipyadc-py3/ADS1256_definitions.py

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-431127320, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjeLC3VnhX51k5KZ2kw-506lSuKopks5umNNegaJpZM4XBeMO .

Theoi-Meteoroi commented 5 years ago

I have one of these waveshare AD boards so I thought I would give the new code a try - I downloaded a zip of the github repo a short while ago.

On activation - the UI error is: Error: Could not activate Input controller with ID 71ef8ad3-788f-42d7-b2a4-6dd707668fec: No module named 'ADS1256_definitions'

the log stack is:

2018-10-18 15:59:06,702 - mycodo.daemon - ERROR - Could not activate Input controller with ID 71ef8ad3-788f-42d7-b2a4-6dd707668fec: No module named 'ADS1256_definitions'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/mycodo_daemon.py", line 506, in controller_activate
    ready, cont_id)
  File "/var/mycodo-root/mycodo/controller_input.py", line 182, in __init__
    self.adc = input_loaded.ADCModule(self.input_dev)
  File "/home/pi/Mycodo/mycodo/inputs/ads1256_input.py", line 95, in __init__
    from ADS1256_definitions import POS_AIN0
ImportError: No module named 'ADS1256_definitions'

import sys

I'm getting readings but will need to work with this a bit more.

Thanks Kyle! Nice addition. I have quite a few analog sensors I want to work with, mostly UV sensors.

SAM26K commented 5 years ago

Kyle, I'm still having problems. When do you think you can look at it again. Code is unchanged from release version. Values aren't right and 3 channels are way off. First 4 channels seemed to be reasonable values but adding a 5th channel it's way off (reads 0.6V instead of 1.6V). Suspicious that ADS1256 is operating in differential mode instead of single-ended. There is 4 differential channels or 8 single-ended. In the code modules, there are comments that say "....set AINn to AINCOM for each single-ended channel.." but have not figured out how to do that in the code yet. Board is already wired with 6 each moisture sensors that are connected as single-ended and works with the Waveshare sample code.

On Thu, Oct 18, 2018 at 4:28 PM Thor notifications@github.com wrote:

I have one of these waveshare AD boards so I thought I would give the new code a try - I downloaded a zip of the github repo a short while ago.

On activation - the UI error is: Error: Could not activate Input controller with ID 71ef8ad3-788f-42d7-b2a4-6dd707668fec: No module named 'ADS1256_definitions'

the log stack is:

2018-10-18 15:59:06,702 - mycodo.daemon - ERROR - Could not activate Input controller with ID 71ef8ad3-788f-42d7-b2a4-6dd707668fec: No module named 'ADS1256_definitions' Traceback (most recent call last): File "/var/mycodo-root/mycodo/mycodo_daemon.py", line 506, in controller_activate ready, cont_id) File "/var/mycodo-root/mycodo/controller_input.py", line 182, in init self.adc = input_loaded.ADCModule(self.input_dev) File "/home/pi/Mycodo/mycodo/inputs/ads1256_input.py", line 95, in init from ADS1256_definitions import POS_AIN0 ImportError: No module named 'ADS1256_definitions'

  • I modified ads1256_input.py to add one line so we get a sys.path and it activates.

import sys

I'm getting readings but will need to work with this a bit more.

Thanks Kyle! Nice addition. I have quite a few analog sensors I want to work with, mostly UV sensors.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-431197003, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjSkkmyoh2xgPie1l-wef_OBN9trfks5umQ6CgaJpZM4XBeMO .

kizniche commented 5 years ago

@Theoi-Meteoroi fixed some issues with the module, namely the incorrect channel sequence, which should fix issues with channels 5, 6, and 7. You'll have to upgrade to the repo master to get the new code.

SAM26K commented 5 years ago

Cool! Should I delete all the mycodo data inputs before upgrading?

On Fri, Oct 19, 2018 at 1:10 PM Kyle Gabriel notifications@github.com wrote:

@Theoi-Meteoroi https://github.com/Theoi-Meteoroi fixed some issues with the module https://github.com/kizniche/Mycodo/pull/553, namely the incorrect channel sequence, which should fix issues with channels 5, 6, and

  1. You'll have to upgrade to the repo master to get the new code.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-431484821, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVje_EPrcyznG46ESEDqPiT1FzKvtdks5umjHFgaJpZM4XBeMO .

kizniche commented 5 years ago

No, that's not necessary for this code change.

Theoi-Meteoroi commented 5 years ago

Looking through the issues against PiPyADC - it becomes clear that the higher sample rates are not going to work with a python driver - at least not directly. As integrated into Mycodo, we are actually taking occasional samples (determined by a Mycodo setting) and not attempting to store every sample the ADC takes. Higher sample rates affect the precision (fewer effective bits) but have much shorter calibration cycles. Cycling between channels requires a settling time lowering the effective throughput, anyway ( see page 21 in the rev. K datasheet ). The upshot is that delta-sigma converters can be very precise ( this is the converter type used in Digital Multimeters ) they have some quirks that can affect accuracy if not addressed or avoided. A thorough reading (and understanding) of the datasheet is necessary to get optimal results.

So my suggestion is to use a lower or the lowest speed setting since we cannot sample fast enough with Mycodo to obtain all the samples captured by the converter. The only benefit I can see from the higher sampling rates is a lower settling time and lower calibration cycle time however those are all sub-second periods anyway. If you want 24 bit precision - you gotta go slow.

SAM26K commented 5 years ago

Kyle, That update looks good so far. All eight channels are reading close to accurate now. Will be playing with data input parameters to try to get closer to actual input but looks good so far!

On Fri, Oct 19, 2018 at 1:42 PM Thor notifications@github.com wrote:

Looking through the issues against PiPyADC - it becomes clear that the higher sample rates are not going to work with a python driver - at least not directly. As integrated into Mycodo, we are actually taking occasional samples (determined by a Mycodo setting) and not attempting to store every sample the ADC takes. Higher sample rates affect the accuracy (fewer effective bits) but have much shorter calibration cycles. Cycling between channels requires a settling time lowering the effective throughput, anyway ( see page 21 in the rev. K datasheet ). The upshot is that delta-sigma converters can be very accurate ( this is the converter type used in Digital Multimeters ) they have some quirks that can affect accuracy if not addressed or avoided. A thorough reading (and understanding) of the datasheet is necessary to get optimal results.

So my suggestion is to use a lower or the lowest speed setting since we cannot sample fast enough with Mycodo to obtain all the samples captured by the converter. The only benefit I can see from the higher sampling rates is a lower settling time and lower calibration cycle time however those are all sub-second periods anyway. If you want 24 bit accurate - you gotta go slow.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-431492919, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjYc2NflWbypFajP6RBIW9O_TwvNWks5umjkhgaJpZM4XBeMO .

SAM26K commented 5 years ago

Feel free to login and check the parameters if you like.

On Fri, Oct 19, 2018 at 2:06 PM John Baxter jbbart03@gmail.com wrote:

Kyle, That update looks good so far. All eight channels are reading close to accurate now. Will be playing with data input parameters to try to get closer to actual input but looks good so far!

On Fri, Oct 19, 2018 at 1:42 PM Thor notifications@github.com wrote:

Looking through the issues against PiPyADC - it becomes clear that the higher sample rates are not going to work with a python driver - at least not directly. As integrated into Mycodo, we are actually taking occasional samples (determined by a Mycodo setting) and not attempting to store every sample the ADC takes. Higher sample rates affect the accuracy (fewer effective bits) but have much shorter calibration cycles. Cycling between channels requires a settling time lowering the effective throughput, anyway ( see page 21 in the rev. K datasheet ). The upshot is that delta-sigma converters can be very accurate ( this is the converter type used in Digital Multimeters ) they have some quirks that can affect accuracy if not addressed or avoided. A thorough reading (and understanding) of the datasheet is necessary to get optimal results.

So my suggestion is to use a lower or the lowest speed setting since we cannot sample fast enough with Mycodo to obtain all the samples captured by the converter. The only benefit I can see from the higher sampling rates is a lower settling time and lower calibration cycle time however those are all sub-second periods anyway. If you want 24 bit accurate - you gotta go slow.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-431492919, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjYc2NflWbypFajP6RBIW9O_TwvNWks5umjkhgaJpZM4XBeMO .

SAM26K commented 5 years ago

One suggestion when you have time is to shorten the default text for the graph labels. Cant see the user channel name in the legends.

On Fri, Oct 19, 2018 at 2:07 PM John Baxter jbbart03@gmail.com wrote:

Feel free to login and check the parameters if you like.

On Fri, Oct 19, 2018 at 2:06 PM John Baxter jbbart03@gmail.com wrote:

Kyle, That update looks good so far. All eight channels are reading close to accurate now. Will be playing with data input parameters to try to get closer to actual input but looks good so far!

On Fri, Oct 19, 2018 at 1:42 PM Thor notifications@github.com wrote:

Looking through the issues against PiPyADC - it becomes clear that the higher sample rates are not going to work with a python driver - at least not directly. As integrated into Mycodo, we are actually taking occasional samples (determined by a Mycodo setting) and not attempting to store every sample the ADC takes. Higher sample rates affect the accuracy (fewer effective bits) but have much shorter calibration cycles. Cycling between channels requires a settling time lowering the effective throughput, anyway ( see page 21 in the rev. K datasheet ). The upshot is that delta-sigma converters can be very accurate ( this is the converter type used in Digital Multimeters ) they have some quirks that can affect accuracy if not addressed or avoided. A thorough reading (and understanding) of the datasheet is necessary to get optimal results.

So my suggestion is to use a lower or the lowest speed setting since we cannot sample fast enough with Mycodo to obtain all the samples captured by the converter. The only benefit I can see from the higher sampling rates is a lower settling time and lower calibration cycle time however those are all sub-second periods anyway. If you want 24 bit accurate - you gotta go slow.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-431492919, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjYc2NflWbypFajP6RBIW9O_TwvNWks5umjkhgaJpZM4XBeMO .

kizniche commented 5 years ago

shorten the default text for the graph labels. Cant see the user channel name in the legends.

I'm not sure what you mean. You can set the names to whatever you like, which will be reflected in the legend labels.

SAM26K commented 5 years ago

Every one of the legend labels just says "ADS1256(Voltage,V)" in the chart dashboard widget. I named them Ch0 to Ch7 but don't see those labels in the chart legend. Not a big deal for me at this point just happy to see the A/D finally working well. :)

On Fri, Oct 19, 2018 at 2:13 PM Kyle Gabriel notifications@github.com wrote:

shorten the default text for the graph labels. Cant see the user channel name in the legends.

I'm not sure what you mean. You can set the names to whatever you like, which will be reflected in the legend labels.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-431500718, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjbJGf55gHTR0e3bcwPrz3P4QIhMQks5umkB6gaJpZM4XBeMO .

kizniche commented 5 years ago
  1. Select Setup -> Data
  2. Change the name of the input, then save
  3. Reload dashboard
  4. Profit
Theoi-Meteoroi commented 5 years ago

There is quite a bit of interaction between settings for the ADC - Increasing the PGA multiplier reduces the full scale voltage range - and that needs to be changed in the Mycodo input settings.

Great the hear it is working for you @SAM26K
Awesome work from @kizniche to get it integrated without actual hardware to pound on.

I can see this addition will probably evolve over time with more use and feedback. The PiPyADC library has a number of features that seem worthwhile to explore further.

SAM26K commented 5 years ago

Ok I get it now. I didnt know you could change the name of the data input control. I was talking about the dashboard element name.] I spoke too soon about the data outputs. At first seemed to be all good but ch 6 and 7 suddenly dropped to half what it should be reading. Channel 6 and 7 are open terminals but should read about 1.15V which it did read when I first ran with the fix but now reading 0.13 or so. Will be experimenting with different max min and other parameters.

On Fri, Oct 19, 2018 at 2:22 PM Kyle Gabriel notifications@github.com wrote:

  1. Select Setup -> Data
  2. Change the name of the input, then save
  3. Reload dashboard
  4. Profit

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/537#issuecomment-431503188, or mute the thread https://github.com/notifications/unsubscribe-auth/AVEVjUc5l-QIpd4B8AIxNgsho1lSV-H5ks5umkKqgaJpZM4XBeMO .