-
-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADS1256 ADC Input addition #537
Comments
Errors out when selecting "Live". Error log: Something bad happened but it's probably not your fault. Letting the developers know about these issues is crucial to supporting Mycodo. Please submit a new issue on GitHub with the following error traceback (copy the entire traceback): Error (Full Traceback): |
Code is modified version of py-ads1256/read_volts_examply.py available on github. When executed from a terminal on the pi itself (pi3B) it works fine and returns the voltage for channel 0 only one time. If I use the "Linux command" input function, it generates above error when "Live" tab is clicked. |
Sorry didn't mean to close issue. |
Code borrowed from here: |
Sorry, this is the first time Im posting on github. Here; is second attempt to post the modified python module code to get the voltage from one channel: 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] |
That didn't work any better than the first attempt, Don't understand the weird formatting. |
Thanks. I'll look into the issues and integrating the ADC |
I fixed this issue with the Linux Command input, however, after you've updated to the latest release (not yet released), you will have to deactivate your controller, save the settings again, then reactivate it for it to be fixed. |
I'll also work on adding this ADC to the builtin inputs. |
I just added the ADC module. You will be able to test it once I make the 6.4.0 release, which could be any day now (maybe even today; I'm not sure how much progress I'll make today toward a release, but I've had a pretty successful bug hunt so far). |
Thank you very much for all your hard work. Is there a way to force the
upgrade? If so, how?
…On Mon, Oct 8, 2018 at 2:24 PM Kyle Gabriel ***@***.***> wrote:
I just added the ADC module. You will be able to test it once I make the
6.4.0 release, which could be any day now (even today, I'm not sure how
much progress I'll make today toward a release, but I've had a pretty
successful bug hunt so far).
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#537 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVEVjeyvS8y7v6twtARDI9avUIP_Jrztks5ui8J8gaJpZM4XBeMO>
.
|
You can upgrade to the master branch with the instructions at https://github.com/kizniche/Mycodo/wiki/Updating-to-Github-Master-Branch When the new release comes out, you will be able to upgrade from this version in the normal way via the upgrade page. |
Hi Kylem
I just tried to do a master upgrade and it failed. Tried a second time
with a complete reinstall and has the same issue. Gives the following
feedback:
[2018-10-11 06:22:56] #### Continuing Upgrade: Stage 2 of 2 ####
[2018-10-11 06:22:56]
[2018-10-11 06:22:56] Moving old Mycodo from /home/pi/Mycodo to
/var/Mycodo-backups/Mycodo-backup-2018-10-11_06-21-31-6.3.9...Done.
[2018-10-11 06:22:56] Moving new Mycodo from /tmp/Mycodo-6.3.9 to
/home/pi/Mycodo...Done.
[2018-10-11 06:23:26]
[2018-10-11 06:23:26] #### Upgrading Mycodo database with alembic (if needed)
[2018-10-11 06:23:33] Failed: Error while updating database with alembic.
[2018-10-11 06:23:33]
[2018-10-11 06:23:33]
[2018-10-11 06:23:33] There was an error during the upgrade.
[2018-10-11 06:23:33] Initial steps to try to fix:
[2018-10-11 06:23:33] 1. Reboot
[2018-10-11 06:23:33] 2. If that doesn't fix the issue, run the
following command:
[2018-10-11 06:23:33] sudo /bin/bash
~/Mycodo/mycodo/scripts/upgrade_commands.sh upgrade
[2018-10-11 06:23:33] 3. If that command returns that you are running
the latest version, run the following command:
[2018-10-11 06:23:33] sudo /bin/bash ~/Mycodo/mycodo/scripts/upgrade_post.sh
…On Wed, Oct 10, 2018 at 9:37 AM Kyle Gabriel ***@***.***> wrote:
You can upgrade to the master branch with the instructions at
https://github.com/kizniche/Mycodo/wiki/Updating-to-Github-Master-Branch
When the new release comes out, you will be able to upgrade from this
version in the normal way via the upgrade page.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#537 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVEVjcKJvriHERHpJibY6BbSlokM9Zprks5ujiJdgaJpZM4XBeMO>
.
|
What was the error encountered during the fresh install? Your log excerpt is only from the upgrade. |
A fresh install from scratch works ok. It's only the master upgrade
generates the error. Also tried the 123 steps in the upgrade error
feedback. Attached are log files,
Thanks again,
…On Thu, Oct 11, 2018 at 7:08 AM Kyle Gabriel ***@***.***> wrote:
What was the error encountered during the fresh install? Your log excerpt
is only from the upgrade.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#537 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVEVjYn3s-JYdJfRtqNukRMZZXUBZk6Nks5uj1DugaJpZM4XBeMO>
.
|
So your fresh install works (fresh installs install from the latest release, not the master branch). Have you attempted an upgrade to the master branch after the fresh install? |
Just tried a third time. Complete reinstall of mycoda works ok but force
upgrade to master branch causes errors. If I click on dashboard tab it
generates a 500 error after upgrading, The upgrade worked once yesterday
or the day before but couldn't get the waveshare a/d working. I noticed
you had done some more updates to the master so tried to upgrade again and
now have these errors.
…On Thu, Oct 11, 2018 at 8:37 AM Kyle Gabriel ***@***.***> wrote:
So your fresh install works (fresh installs install from the latest
release, not the master branch). Have you attempted an upgrade to the
master branch after the fresh install?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#537 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVEVjfUa6ejhxyaPDHbF8FzRJDDAs3Kvks5uj2WkgaJpZM4XBeMO>
.
|
Can you paste the contents of the upgrade log? |
Attached are the log files. Is that ok?
…On Thu, Oct 11, 2018 at 8:47 AM Kyle Gabriel ***@***.***> wrote:
Can you paste the contents of the upgrade log?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#537 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVEVjXB3a5hJh7SdabSkhC5kZK76M7v1ks5uj2gWgaJpZM4XBeMO>
.
|
Sorry, but you'll have to log on to github.com to attach files. You can't do it by replying to the email notification. Thanks. |
Oh ok. Here it is:
Edit: Deleted by Kyle Gabriel (too long)
|
From your log, above, you were performing an upgrade from 6.2.2 to 6.3.9, not upgrading to the master branch from a fresh install of the latest release (v6.3.9).
|
When upgrading to the master branch, the first line of the upgrade log (excerpt) will be:
|
You happened to have caught me right as I am making the 6.4.0 release. It's now released, so you can either upgrade normally or perform a fresh install to get it. |
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: the log stack is:
import sysI'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. |
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 ***@***.***> 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
<#537 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVEVjSkkmyoh2xgPie1l-wef_OBN9trfks5umQ6CgaJpZM4XBeMO>
.
|
@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. |
Cool! Should I delete all the mycodo data inputs before upgrading?
…On Fri, Oct 19, 2018 at 1:10 PM Kyle Gabriel ***@***.***> wrote:
@Theoi-Meteoroi <https://github.com/Theoi-Meteoroi> fixed some issues
with the module <#553>, 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.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#537 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVEVje_EPrcyznG46ESEDqPiT1FzKvtdks5umjHFgaJpZM4XBeMO>
.
|
No, that's not necessary for this code change. |
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 ). 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. |
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 ***@***.***> 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
<#537 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVEVjYc2NflWbypFajP6RBIW9O_TwvNWks5umjkhgaJpZM4XBeMO>
.
|
Feel free to login and check the parameters if you like.
…On Fri, Oct 19, 2018 at 2:06 PM John Baxter ***@***.***> 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 ***@***.***> 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
> <#537 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AVEVjYc2NflWbypFajP6RBIW9O_TwvNWks5umjkhgaJpZM4XBeMO>
> .
>
|
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 ***@***.***> wrote:
Feel free to login and check the parameters if you like.
On Fri, Oct 19, 2018 at 2:06 PM John Baxter ***@***.***> 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 ***@***.***> 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
>> <#537 (comment)>,
>> or mute the thread
>> <https://github.com/notifications/unsubscribe-auth/AVEVjYc2NflWbypFajP6RBIW9O_TwvNWks5umjkhgaJpZM4XBeMO>
>> .
>>
>
|
I'm not sure what you mean. You can set the names to whatever you like, which will be reflected in the legend labels. |
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 ***@***.***> 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
<#537 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVEVjbJGf55gHTR0e3bcwPrz3P4QIhMQks5umkB6gaJpZM4XBeMO>
.
|
|
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 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. |
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 ***@***.***> 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
<#537 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVEVjUc5l-QIpd4B8AIxNgsho1lSV-H5ks5umkKqgaJpZM4XBeMO>
.
|
@SAM26K Are you using calibration? What sample rate setting? |
Hi Thor, Yes using self offset and gain, Thats the one that uses an
internal reference to cal and should be accurate.
…On Fri, Oct 19, 2018 at 2:47 PM Thor ***@***.***> wrote:
@SAM26K <https://github.com/SAM26K> Are you using calibration? What
sample rate setting?
I set my calibration to "Self Offset + Self Gain"
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#537 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVEVjWNO6yURUoJpCTQPlUuTU0YeqMk7ks5umkhpgaJpZM4XBeMO>
.
|
Using 2.5 sample rate but experimenting with that.
…On Fri, Oct 19, 2018 at 2:49 PM John Baxter ***@***.***> wrote:
Hi Thor, Yes using self offset and gain, Thats the one that uses an
internal reference to cal and should be accurate.
On Fri, Oct 19, 2018 at 2:47 PM Thor ***@***.***> wrote:
> @SAM26K <https://github.com/SAM26K> Are you using calibration? What
> sample rate setting?
> I set my calibration to "Self Offset + Self Gain"
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#537 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AVEVjWNO6yURUoJpCTQPlUuTU0YeqMk7ks5umkhpgaJpZM4XBeMO>
> .
>
|
Changed sample rate to 100 for all channels and still last two channels
were accurate for first couple of minutes then dropped way down for some
reason. Using default 15 sec refresh rate.
There are still flukes with the code.
…On Fri, Oct 19, 2018 at 2:51 PM John Baxter ***@***.***> wrote:
Using 2.5 sample rate but experimenting with that.
On Fri, Oct 19, 2018 at 2:49 PM John Baxter ***@***.***> wrote:
> Hi Thor, Yes using self offset and gain, Thats the one that uses an
> internal reference to cal and should be accurate.
>
>
> On Fri, Oct 19, 2018 at 2:47 PM Thor ***@***.***> wrote:
>
>> @SAM26K <https://github.com/SAM26K> Are you using calibration? What
>> sample rate setting?
>> I set my calibration to "Self Offset + Self Gain"
>>
>> —
>> You are receiving this because you were mentioned.
>> Reply to this email directly, view it on GitHub
>> <#537 (comment)>,
>> or mute the thread
>> <https://github.com/notifications/unsubscribe-auth/AVEVjWNO6yURUoJpCTQPlUuTU0YeqMk7ks5umkhpgaJpZM4XBeMO>
>> .
>>
>
|
Big improvement though. 6 channels that have sensors display reasonable
values.
…On Fri, Oct 19, 2018 at 3:11 PM John Baxter ***@***.***> wrote:
Changed sample rate to 100 for all channels and still last two channels
were accurate for first couple of minutes then dropped way down for some
reason. Using default 15 sec refresh rate.
There are still flukes with the code.
On Fri, Oct 19, 2018 at 2:51 PM John Baxter ***@***.***> wrote:
> Using 2.5 sample rate but experimenting with that.
>
> On Fri, Oct 19, 2018 at 2:49 PM John Baxter ***@***.***> wrote:
>
>> Hi Thor, Yes using self offset and gain, Thats the one that uses an
>> internal reference to cal and should be accurate.
>>
>>
>> On Fri, Oct 19, 2018 at 2:47 PM Thor ***@***.***> wrote:
>>
>>> @SAM26K <https://github.com/SAM26K> Are you using calibration? What
>>> sample rate setting?
>>> I set my calibration to "Self Offset + Self Gain"
>>>
>>> —
>>> You are receiving this because you were mentioned.
>>> Reply to this email directly, view it on GitHub
>>> <#537 (comment)>,
>>> or mute the thread
>>> <https://github.com/notifications/unsubscribe-auth/AVEVjWNO6yURUoJpCTQPlUuTU0YeqMk7ks5umkhpgaJpZM4XBeMO>
>>> .
>>>
>>
|
I'm currently in the middle of a huge refactoring of the Function section. Specifically, splitting conditionals into Triggers and Conditionals, and improving the conditional functionality (#493). Anyway, why I mention it is because the next thing I'll be tackling after finishing this (listed in #550) is refactoring the ADC measurement system. This will include the ability to, instead of having to add a new Input for each channel, only one Input will need to be added, and the channels you wish to measure and store values of can be selected. Each channel will be able to have the voltages/units set from this one Input. This will allow the Input modules to be restructured to allow:
|
Sounds excellent Kyle. Is there a tutorial or wiki you can point me to
with instructions on how to create an input data module for mycodo?
…On Fri, Oct 19, 2018 at 3:20 PM Kyle Gabriel ***@***.***> wrote:
I'm currently in the middle of a huge refactoring of the Function section.
Specifically, splitting conditionals into Triggers and Conditionals, and
improving the conditional functionality (#493
<#493>).
Anyway, why I mention it is because the next thing I'll be tackling after
finishing this (listed in #550
<#550>) is refactoring the ADC
measurement system. This will include the ability to, instead of having to
add a new Input for each channel, only one Input will need to be added, and
the channels you wish to measure and store values of can be selected. Each
channel will be able to have the voltages/units set from this one Input.
This will allow the Input modules to be restructured so that:
- Drastically speed up measurements because there is only one Input
attempting to read the ADC.
- All measurements will be acquired at the same time (which will also
allow all measurements on the graphs to align, making it nice to view all
measurements at the same time in the tooltip).
- Make the use of a lockfile unnecessary (there's a lockfile issue
where occasionally all modules will get stuck unable to acquire a lock;
it's a nasty bug that I have no idea what causes).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#537 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVEVjcjXjFhbZ5dSZ0watKKCnsE18TEVks5umlBKgaJpZM4XBeMO>
.
|
Standalone Input module functionality was very recently added, so I haven't had the time to cover it in detail, but there is a bit of information in the manual. |
So far so good. 6 channels with sensors seem to have stable readings.
…On Fri, Oct 19, 2018 at 3:36 PM Kyle Gabriel ***@***.***> wrote:
Standalone Input module functionality was very recently added, so I
haven't had the time to cover it in detail, but there is a bit of
information in the manual
<https://github.com/kizniche/Mycodo/blob/master/mycodo-manual.rst#create-your-own-input-module>
.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#537 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVEVjf6lTrdxEUrk4QqOEfgYvFyr_fnRks5umlPdgaJpZM4XBeMO>
.
|
ran into the dreaded lock bug after adding all channels in a tight loop. Will take a look at the code to see if I can assist. 2018-10-19 16:43:00,105 - mycodo.input_82897384 - ERROR - Error while attempting to read adc: [Errno 2] No such file or directory: '/var/lock/mycodo_adc_uart-ADS1256' During handling of the above exception, another exception occurred: Traceback (most recent call last): |
Getting reasonably accurate and stable numbers from the Waveshare ADS1256
A/D shield pcb.
Rough calibration of the UI as follows:
1. Set input voltage range to 0-5V.
2. Set Units to 0-4.74.
Using sample speed of 1000 and gain of 2 although those parameters don't
seem to have a lot of effect on the readings. Actual sensors have a range
of about 1.2-2.5VDC but the A/D board is wired for +/-5V in.
Don't know how linear the sensor voltage is to the mycodo readouts yet but
varying the min units and max units will compensate for non-linearty. Not
sure why cal is necessary though as the Waveshare example code is not
adjustable but is accurate.
|
Also using update intervals of 15 seconds but would like to increase that
to 15 mins or more once I'm confident everything is working well.
…On Sat, Oct 20, 2018 at 12:01 PM John Baxter ***@***.***> wrote:
Getting reasonably accurate and stable numbers from the Waveshare ADS1256
A/D shield pcb.
Rough calibration of the UI as follows:
1. Set input voltage range to 0-5V.
2. Set Units to 0-4.74.
Using sample speed of 1000 and gain of 2 although those parameters don't
seem to have a lot of effect on the readings. Actual sensors have a range
of about 1.2-2.5VDC but the A/D board is wired for +/-5V in.
Don't know how linear the sensor voltage is to the mycodo readouts yet but
varying the min units and max units will compensate for non-linearty. Not
sure why cal is necessary though as the Waveshare example code is not
adjustable but is accurate.
|
All the channels are configured for "self offset and gain" calibration.
…On Sat, Oct 20, 2018 at 12:13 PM John Baxter ***@***.***> wrote:
Also using update intervals of 15 seconds but would like to increase that
to 15 mins or more once I'm confident everything is working well.
On Sat, Oct 20, 2018 at 12:01 PM John Baxter ***@***.***> wrote:
> Getting reasonably accurate and stable numbers from the Waveshare ADS1256
> A/D shield pcb.
> Rough calibration of the UI as follows:
> 1. Set input voltage range to 0-5V.
> 2. Set Units to 0-4.74.
> Using sample speed of 1000 and gain of 2 although those parameters don't
> seem to have a lot of effect on the readings. Actual sensors have a range
> of about 1.2-2.5VDC but the A/D board is wired for +/-5V in.
> Don't know how linear the sensor voltage is to the mycodo readouts yet
> but varying the min units and max units will compensate for non-linearty.
> Not sure why cal is necessary though as the Waveshare example code is not
> adjustable but is accurate.
>
|
Would suggest listing this device as a Waveshare ADS156 instead of TI. TI
makes the chip but Waveshare makes the actual device.
…On Sat, Oct 20, 2018 at 12:17 PM John Baxter ***@***.***> wrote:
All the channels are configured for "self offset and gain" calibration.
On Sat, Oct 20, 2018 at 12:13 PM John Baxter ***@***.***> wrote:
> Also using update intervals of 15 seconds but would like to increase that
> to 15 mins or more once I'm confident everything is working well.
>
> On Sat, Oct 20, 2018 at 12:01 PM John Baxter ***@***.***> wrote:
>
>> Getting reasonably accurate and stable numbers from the Waveshare
>> ADS1256 A/D shield pcb.
>> Rough calibration of the UI as follows:
>> 1. Set input voltage range to 0-5V.
>> 2. Set Units to 0-4.74.
>> Using sample speed of 1000 and gain of 2 although those parameters don't
>> seem to have a lot of effect on the readings. Actual sensors have a range
>> of about 1.2-2.5VDC but the A/D board is wired for +/-5V in.
>> Don't know how linear the sensor voltage is to the mycodo readouts yet
>> but varying the min units and max units will compensate for non-linearty.
>> Not sure why cal is necessary though as the Waveshare example code is not
>> adjustable but is accurate.
>>
>
|
Waveshare ADS1256 instead of Texas Instruments. That will make it simpler
for people to identify the actual hardware.
…On Sat, Oct 20, 2018 at 12:29 PM John Baxter ***@***.***> wrote:
Would suggest listing this device as a Waveshare ADS156 instead of TI. TI
makes the chip but Waveshare makes the actual device.
On Sat, Oct 20, 2018 at 12:17 PM John Baxter ***@***.***> wrote:
> All the channels are configured for "self offset and gain" calibration.
>
> On Sat, Oct 20, 2018 at 12:13 PM John Baxter ***@***.***> wrote:
>
>> Also using update intervals of 15 seconds but would like to increase
>> that to 15 mins or more once I'm confident everything is working well.
>>
>> On Sat, Oct 20, 2018 at 12:01 PM John Baxter ***@***.***> wrote:
>>
>>> Getting reasonably accurate and stable numbers from the Waveshare
>>> ADS1256 A/D shield pcb.
>>> Rough calibration of the UI as follows:
>>> 1. Set input voltage range to 0-5V.
>>> 2. Set Units to 0-4.74.
>>> Using sample speed of 1000 and gain of 2 although those parameters
>>> don't seem to have a lot of effect on the readings. Actual sensors have a
>>> range of about 1.2-2.5VDC but the A/D board is wired for +/-5V in.
>>> Don't know how linear the sensor voltage is to the mycodo readouts yet
>>> but varying the min units and max units will compensate for non-linearty.
>>> Not sure why cal is necessary though as the Waveshare example code is not
>>> adjustable but is accurate.
>>>
>>
|
Mycodo Issue Report:
Problem Description
Please list:
Since this pcb is not on the sensor list, I'm using some python code (called by some Linux bash code) to return the selected channels voltage. This is the bash code:
Errors
code lines you've isolated (please use GitHub permalinks for this)
Steps to Reproduce the issue:
How can this issue be reproduced?
Additional Notes
Is there anything that should be added to make it easier
to address this issue?
The text was updated successfully, but these errors were encountered: