more G-Labs products

Author Topic: MCP3008  (Read 849 times)

July 08, 2016, 04:46:18 PM
Read 849 times

fra290

  • *
  • Information
  • Newbie
  • Posts: 15
As attached image...
I installed the MCP3008 module with the package install tool in without any error.
I put two test module (MCP3008's virtual module) in one group.
the hardware shoud work fine because I can see the right value in a Log file and in popup menu (see the oictures)
But...
no any value appair on Widget and in the bottom part of widget there is write:
"undefined, NaN/NaN...

any idea?, I have just install the 1.1 beta r525
Thank You

July 15, 2016, 12:36:20 PM
Reply #1

fra290

  • *
  • Information
  • Newbie
  • Posts: 15
I re-installed all with a frash configuration with only GPIO and MCP3008 modules.
the vertual module still not working but now I have one new problem:
the MCP3008 program start and sotp after minutes with this error:

"Collection was modified; enumeration operation may not execute"

anyone have any idea what it means ?
TNK in advance
   MArco



July 15, 2016, 10:12:19 PM
Reply #2

fra290

  • *
  • Information
  • Newbie
  • Posts: 15
I'm just fix the problem of  "Collection was modified...." by re-installing Mono in a previus revision
but the virtual module  still not working.. do data and description sowed and "undefined: NaN, Nan..." in the footer.
I'm fighting to undestend how the widget ad virtual module work.

welcome aid....

   MArco

July 15, 2016, 10:42:46 PM
Reply #3

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
The sensor widget only display parameters with name starting with "Sensor." eg. "Sensor.Temperature" so you have to map raw values to sensor parameters.

July 17, 2016, 12:39:49 AM
Reply #4

fra290

  • *
  • Information
  • Newbie
  • Posts: 15
Thanks Gene, now is iltle bit clear.
If I use Sensor.Temperature the widget work fine,  widget display correct value, icon and unit of mesure.

but in my case the with the ADC I tray to mesure voltage, current , etc.
if I use Sensor.Tensione still not work.

I found one istruction like case 'Sensor.Temperature': in the widget's javascript but there isn't
I'm confused where is te contol? can I use one generic name for parameters with name starting with "Sensor."?

thank you a lot
   MArco

July 18, 2016, 12:24:32 PM
Reply #5

fra290

  • *
  • Information
  • Newbie
  • Posts: 15
I do not know if this is a right way but i solve my problem by a new widget for MCP3008.
as picture attached now is possible display the vaule and the unit of mesure and max and min value.

if you can use this widget
  • install widget attached
  • Change the default widget in MCP3008 Analog input module startupcode withProgram.AddVirtualModule("Components.MCP3008", "CH0", "Sensor", "homegenie/generic/adc")
  • Configure the module with "parameter name to store computed value" as MCP3008.<Unit of mesure> i.e MCP3008.V, MCP3008.mA, etc.

   MArco