ARDUINO plugin discussion

Posted on
Mon Jun 29, 2015 10:34 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: ARDUINO plugin discussion

mclass :

the newly posted version 1.2.2 should fix it , was a parsing error... it worked by accident if you use > 6 active pins which I always did..

http://forums.indigodomo.com/viewtopic.php?f=164&t=14043&p=98803#p98803

karl

Posted on
Tue Jun 30, 2015 8:44 pm
mclass offline
Posts: 315
Joined: May 13, 2015
Location: Melbourne, Australia

Re: ARDUINO plugin discussion

Karl,

As PM'd, it sure did (fix it)!

Thanks

Posted on
Sat Jul 25, 2015 11:49 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: ARDUINO plugin discussion

...
Data is being captured and parsed, but not to the devices status section.
Also how are variables created and updated, I am hoping to put some dials on a controls page. second image attached
Again help really appreciated, ad thanks for the great plugin

moomin: which version are you using. I don't see the "parse str ..." log file output
Screen Shot 2015-07-25 at 12.31.07 PM.png
Screen Shot 2015-07-25 at 12.31.07 PM.png (42.86 KiB) Viewed 5402 times
in my latest version. May be I posted an older version? The most recent should be 1.2.2 here:http://forums.indigodomo.com/viewtopic.php?f=178&t=14043&p=99821#p99821

As for the "variables" I guess you mean the "STATES" e.g. Pin_A1 ..Pin_D5..

How to use: you need to use some python in an action or schedule server/script:
dev= indigo.devices["yourIndigoArduinoDeviceNameHere"]
a1= float(dev.states["Pin_A1"])
d5= float(dev.states["Pin_D5"])
or in one line:
a1= float(indigo.devices["yourIndigoArduinoDeviceNameHere"].states["Pin_A1"])
d5= float(indigo.devices["yourIndigoArduinoDeviceNameHere"].states["Pin_D5"])
will put the contents of the "state" "Pin_A1" of the device "yourIndigoArduinoDeviceNameHere" into a variable a1 as a floating point number if no float() it will be a string. You then can use it to e.g. send email etc.

How do "variables" get updated:
the plugin queries the arduino on a regular basis and then updates the "device- states". You can set the timing in the config menus.


Dont hesitate to ask questions.

hope that helps

Karl

ps
yourIndigoArduinoDeviceNameHere I believe is Arduino in your setup

and leave the quotes "xxx" in the code they indicate a string for the device name and state name.
you could use {12345] for the device ID instead of the name with "xxx": right click on the device in the indigo menu and select copy indigo Id to get the ID

Posted on
Tue Aug 25, 2015 5:54 am
jens offline
Posts: 265
Joined: May 03, 2015
Location: Sweden

Re: ARDUINO plugin discussion

which Arduino hardware should I buy? wants to connect wired network and control relays and measuring temperature, humidity :)

Best Regards Jens

Posted on
Tue Aug 25, 2015 4:38 pm
mclass offline
Posts: 315
Joined: May 13, 2015
Location: Melbourne, Australia

Re: ARDUINO plugin discussion

Hi Jens!

I've had success with a "Freetronics Etherten" board with a relay shield. The Etherten is Uno compatible with integrated Ethernet. It's manufactured here in Australia, so availability in your location may be an issue.
mclass


Sent from my iPhone using Tapatalk

Posted on
Tue Aug 25, 2015 5:06 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: ARDUINO plugin discussion

which Arduino hardware should I buy? wants to connect wired network and control relays and measuring temperature, humidity


The plugin is tested with uno (with wifi and ethernetboard) and uno-ethernet and mega (with wifi and ethernet board)

I am running 2 of these for > 18 month without ANY problems. no hardware issue, no reboots, no hanging .. EXTREMELY reliable.

Unfortunately the ethernet/wifi boards are expensive. There are some Chinese copies of the ethernet board ($15). I tried one and it worked well = no problem.

I am currently looking the adafruit Huzzah(wifi included). It is an ESP8622 with arduino compliment mode. They are available for $15.

besides that you are right the # of options is infinite. I can just state what I tried so far.


Karl

Posted on
Wed Aug 26, 2015 2:36 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: ARDUINO plugin discussion

nodeMCU

with the release of the ESP version of the plugin I am now testing some of the variations..

nodeMCU seems to work, but the Dx pin # mappings are different than the adafruit . It has
D0..D8,
while the adafruit Huzzah has
D0, D2,D4,D5,D12,D13,D14,D15,D16
as GPIO pins

It is
nodeMCU <= AdaFruit =Plugin: [EDIT]
d0 <= D16
d1 <= D5
d2 <= D4
d3 <= D0
d4 <= D2
d5 <= D14
d6 <= D12
d7 <= D13
d8 <= D15

so if you want to write to nodeMCU GPIO pin 5 you need to select plugin pin# 14

the analog pin is easy, there is only one: A0



Karl

I guess this is known:
Attachments
Screen Shot 2015-08-26 at 4.26.16 PM.png
Screen Shot 2015-08-26 at 4.26.16 PM.png (67.97 KiB) Viewed 5259 times

Posted on
Wed Aug 26, 2015 9:04 pm
mclass offline
Posts: 315
Joined: May 13, 2015
Location: Melbourne, Australia

Re: ARDUINO plugin discussion

Thanks to kw123 for his amazing work on the ESP8266 additions. This has great potential for lower cost battery powered wireless senors/actuators for Indigo!

I've had a brief opportunity to load and test this with a Sparkfun Thing, albeit only with a single digital input before I had to get back to real work. I encountered a couple of issues that may assist others:

- When installing the new Indigo plugin, I received a warning that I was "downgrading" to an earlier version. However the new version does load and run OK.
- The Thing is programmed using a FTDI adapter that holds the GPIO 0 pin low as is required by the ESP8266. While this makes the process simple, if you leave the the adapter connected the sketch won't run (took me a few minutes to twig to this!)
- Ensure you select the correct board in the Arduino IDE before attempting to upload the sketch (I didn't at first)
- Make sure you've got plenty of power to the Thing - it performed in an unpredictable manner when powered from the Mac Mini's USB port. A mains adapter solved that issue OK

Looking forward to further testing and applying this to a real application when time permits. - I'm thinking garage door sensing and operation initially. In the meantime I'd be interested in reading of others' experiences/applications.

Thanks again, kw123!

mclass

Posted on
Thu Aug 27, 2015 7:20 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: ARDUINO plugin discussion

has anyone tried opto couplers?

for driving electronics relays are too big, expensive, slow, etc

e.g.:http://www.amazon.com/gp/product/B00BJHPDTQ?psc=1&redirect=true&ref_=oh_aui_detailpage_o04_s00
Screen Shot 2015-08-27 at 8.13.28 PM.png
Screen Shot 2015-08-27 at 8.13.28 PM.png (72.11 KiB) Viewed 5215 times
Photo/Opto Coupler.

They should be fine if we want to drive e.g. 3rd party remotes.
They insulate, can drive ~ 20mA are small, do not make noise ..

you need 1 resistor (~ 200/600Ohm depending on voltage 3.3V/5V) between arduino output and opto Coupler input, the other end goes to ground.
On the driving side it depends what you like to do.


Karl

Posted on
Thu Aug 27, 2015 11:47 pm
DrLove offline
Posts: 260
Joined: Dec 12, 2014
Location: Sweden

Re: ARDUINO plugin discussion

I would go with a transistor directly instead if you don't need the optical isolation.

//L

Love Kull (yes it's my name)
Blog (in Swedish)
Sweden

Posted on
Fri Aug 28, 2015 10:45 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: ARDUINO plugin discussion

proposed changes:

1. for pulse and moment mode replace in the sketch:
analogWrite(j,255) and analogWrite(j,0)
with
digitalWrite(pin,1) and digitalWrite(pin,0)

The difference is that digital write set the output to ~2.9 v / 4V vs analog write (255) set the output to ~ 1 volt.Thats not enough to drive some electronics

2. remove the virtual pins F and I and increase the number of virtual pins S from 5 to 10
the are in principle all the same during sending all are strings and what you do with then is up to you anyway.
F and I were meant to be for floats and integers but "123" in an "S" pin is the same as "123" in an "I" pin
they are just ways to send and receive strings and you need to write a program anyway to use them in the sketch.


3. add a ramp up and ramp down mode. It would ramp up(down) the output voltage of a GPIO pin in x milliseconds (where 0.5 seconds would be a practical limit)
parameter: time length in milli-seconds and max V value (0-255)
This can be used to drive any analog device . Please be aware that the output is not simply a DC value but the DC value is emulated by a number of pulses at Vmax.
I believe the ARDUINO is pulsing at 1 kHz so a value of 1 would mean every 255 milli seconds one pulse, or 4 pulses a second to emulate a value of 1/255. I guess a small capacitor would help to smooth things out.


4. would there be a need to add the pull-up or pull-down output mode to the selectable pin modes?


Thanks


Karl

Just got my spark fun arduino ESP boards, will test them later.


it looks as if this setup now supports
uno +wifi/ethernet
uno-ethernet
mega +wifi/ethernet
ESP:
adafruit
nodeMCU
sparkfun arnuino / "thing"

and the ESP1 should work too, just need to get the program onto the chip.

Posted on
Sat Aug 29, 2015 10:10 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: ARDUINO plugin discussion

new version 2.0.1 posted at http://forums.indigodomo.com/viewtopic.php?f=178&t=14043&p=101196#p101196

you need to load the attached sketch to work with this plugin. I did some cleanup of the plugin and the sketch. Also added:
- ramp up(down) the output value from 0..255 (* voltage) in xx milliseconds

Attached is also complete set of python calls to set / read variables and functions. It is actually simple to use. Copy the code you like into and action group / execute script, change your device name and pin number and click on run.

I have tested this plugin with:
Arduino uno/mega w wifi/ethernet,
ESP8622: nodemcu, Adafruit, sparkfun. -- not yet the 8 pin one active GPIO version
All of them seem to be stable. The only thing I found that the ESP once set to analog write can not be switched back to digital output , only with a reset.

Karl

ps I have deleted all the old version. Will from now on only post the most recent version to keep the download short.
Folks that have posted questions there, could you remove your posts from the download section?
If you need an older one let me know.

Posted on
Sun Aug 30, 2015 3:33 am
jens offline
Posts: 265
Joined: May 03, 2015
Location: Sweden

Re: ARDUINO plugin discussion

Do you mean that you can control a 0-10 V dimmer then? Or have I got it wrong :roll: :)

//Jens

Posted on
Sun Aug 30, 2015 5:47 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: ARDUINO plugin discussion

I guess you are referring to 0..255 *voltage. On the ESP the range is 0- 0.8v and on the arduino it is 0-2v I believe. The o-255 is just the binary range you can supply in analogWrite on the esp/arduino.
*voltage was meant to indicate there is a multiplication factor involved.


Sent from my iPhone using Tapatalk

Posted on
Sun Aug 30, 2015 7:25 am
jens offline
Posts: 265
Joined: May 03, 2015
Location: Sweden

Re: ARDUINO plugin discussion

Okey, then I get it wrong


Sent from my iPhone 6 using Tapatalk

Page 4 of 34 1, 2, 3, 4, 5, 6, 7 ... 34

Who is online

Users browsing this forum: No registered users and 4 guests