new version 7.9.9 published on indigo store: https://www.indigodomo.com/pluginstore/74/
older versions===============
https://www.dropbox.com/s/fbqf03188732u ... 8.zip?dl=1
https://www.dropbox.com/s/vu0l0x1vazprl ... 5.zip?dl=1
https://www.dropbox.com/s/5hvdh6r5zovay ... 6.zip?dl=1 added soft reset for no wifi contact for 5 minutes
Version 7.9.8 and sketch version 1.10.5
Purpose: Integrate Arduino boards into Indigo via WiFi or Ethernet. It can set Pins and read Pin Values, make them available as indigo device states
What can it do:
1. read/write/ count input changes any enabled INPUT /OUTPUT analog or digital pin on an arduino UNO / mega with ethernet / wifi and ESP modules like ADAfruit HUZZAH or sparkfun thing
2. program pins:
== to be INPUT or OUTPUT or count 0to1 count 1to0 with/whithout INPUT_PULLUP internal resistor enabled or OFF
3. set output pins (GPIO) to
== HIGH/LOW
== analog write value 0..255 (0...1023 for ESP)
== ramp output up/down from a to b in x milliseconds( a..b: 0...1023 for ESP, 0..255 for arduino);
== ramp output up/down from a to b in x milliseconds continuously ( a..b: 0...1023 for ESP, 0..255 for arduino)
== send a(single) moment pulse up or down for xx milliseconds = switch output on / off for x miliseconds
== make output continuously go high/low for xx milliseconds up and yy milliseconds down
4. the states in the device listing will reflect the values of the enabled read pins and commands send to the output pins
5. An action in an action group (arduino Action / SetPin Value or Set Pin Mode) can do anything under # 2 & #3
6. through python calls (see below) set/program the pins (essentially the same thing as #5)
7. In Indigo/Plugin/Arduino/Menu you can set Pin Modes or Pin Values or functions (same as #6)
8. included in the INO file are examples for DHT and DS18B20 temp / humidity sensors
9. the plugin supports ESP 1/16/arduino uno/megae with wifi or Ethernet and a FREEdevice that has no limits/ constraints. with 50 D; 16 A and 20 S pins
In addition to the Analog and Digital pins the plugin supports "virtual Pins" (S0..S19). The are just text Strings that can be send to the arduino or send by the arduino.
You can use them as commands parameters in your own Sketch when you like to modify the sketch in this package.
See doMyStuff() in the attached sketches for some examples
Once setup you can then can set e.g. triggers on the device states like for any other device / state
The plugin will detect if the Arduino has been rebooted and needs to be newly configured and will execute the commands to do that.
sainsmart relay boards
the plugin now supports sainsmart relay boards 1...8 relays.https://www.sainsmart.com/products/rj45 ... -ch-relays
no specific config in the plugin is required, but the board needs to be setup with proper IP and port number at @http://192.168.1.4/30000/41
then enter the IP and port number into the device edit.
After that you can use the sainsmart device as a relay output device in indigo.
Setup Steps:
0.You must download the arduino.ino sketch attached in the zip file to your UNO/MEGA+ethernet/WIFI or ESP board . .. and set the proper IP number (and MAC# for ethernet) and or Wifi SSID/password in the sketch
1. setup one device per arduino/ESP in indigo
2. for each device you can/must define in the device edit menu
- ip number of device
- time between reads of arduino
- which analog pins should be read (on/off)
- which digital pins should be INPUT/OUTPUT/INPUT_PULLUP /OFF
After that the plugin will do an http to the ardino and update the proper states in the device depending on the schedule you set in the device config
here examples of the available Actions in python from action groups or any other plugin or python script. They can also be selected in the action menu manually
Code: Select all
## first get plugin
plug = indigo.server.getPlugin("com.karlwachs.arduino")
if not plug.isEnabled(): return #### ARDUINO must be enabled, otherwise nothing here works
## execute actions to set pins / read pins etc.
## after each action a variable in ArduinoLastMessage folder gets updated with the reply / success from arduino
plug.executeAction("setPins" , ### send ON to D4 pin
props ={
"CMD":"ONoff"
,"Pin" :"D4"
,"lowHIGH":"1" ## use "0" for OFF
,"device": "162205879"} # indigo deviceId# or device name
)
plug.executeAction("setPins" , ### ramp pin D4 up and down
props ={
"CMD":"rampUPDown"
,"Pin" :"D4"
,"msecUP":"1000" ## 1 sec up
,"msecDOWN":"3500" ## 3.5 sec down
,"minValue":"10" ## from PWM value =10
,"maxValue":"200" ## to PWM value=200 (max =255 with arduino, 1023 with ESP)
,"device": "arduino15"} # indigo deviceId# or device name
)
plug.executeAction("setPins" , ### ramp pin D4 up
props ={
"CMD":"rampUp"
,"Pin" :"D4"
,"msecUP":"1000" ## 1 sec up
,"minValue":"10" ## from PWM value =10
,"maxValue":"200" ## to PWM value=200 (max =255 with arduino, 1023 with ESP)
,"device": "arduino15"} # indigo deviceId# or device name
)
plug.executeAction("setPins" , ### ramp pin D4 down
props ={
"CMD":"rampDown"
,"Pin" :"D4"
,"msecDOWN":"1000" ## 1 sec down
,"minValue":"0" ## to PWM value =0
,"maxValue":"200" ## fromPWM value=200 (max =255 with arduino, 1023 with ESP)
,"device": "arduino15"} # indigo deviceId# or device name
)
plug.executeAction("setPins" , ###pulses up and down, digital write
props ={
"CMD":"pulseUp"
,"Pin" :"D4"
,"msecUP":"1000" ## 1 sec up
,"msecDOWN":"1000" ## 1 sec down
,"device": "arduino15"} # indigo deviceId# or device name
)
plug.executeAction("setPins" , ###pulses down and up , digital write
props ={
"CMD":"pulseUp"
,"Pin" :"D4"
,"msecUP":"1000" ## 1 sec up
,"msecDOWN":"1000" ## 1 sec down
,"device": "arduino15"} # indigo deviceId# or device name
)
plug.executeAction("setPins" , ###pulses down and up , analog write
props ={
"CMD":"analogWrite"
,"Pin" :"D4"
,"aValue":"100" # write a 100 to D4 PWM
,"device": "arduino15"} # indigo deviceId# or device name
)
plug.executeAction("setPins" , ###on pulse up (moment)
props ={
"CMD":"momentUp"
,"Pin" :"D4"
,"msecUP":"1000" ## 1 sec up
,"device": "arduino15"} # indigo deviceId# or device name
)
plug.executeAction("setPins" , ###on pulse down (moment)
props ={
"CMD":"momentDown"
,"Pin" :"D4"
,"msecDOWN":"1000" ## 1 sec up
,"device": "arduino15"} # indigo deviceId# or device name
)
plug.executeAction("setPins" , ## reset count of pin D4
props ={
"CMD":"CountReset"
,"Pin" :"D4"
,"device": "arduino15"} # indigo deviceId# or device name
)
plug.executeAction("setPins" , ## read value of D4
props ={
"CMD":"read"
,"Pin" :"D4"
,"device": "arduino15"} # indigo deviceId# or device name
)
plug.executeAction("setPins" , ## read value of a0
props ={
"CMD":"read"
,"Pin" :"A4"
,"device": "arduino15"} # indigo deviceId# or device name
)
### set 2 S pins at once: first set each with "setOnly" option, then do "sendPins" for S1,s0
plug.executeAction("setPins",
props={
"device" :"1780896723" # or device name
,"pin": "s0" #
,"CMD": "analogWrite"
,"aValue":"123"
,"sendORset":"setOnly"
}
)
plug.executeAction("setPins",
props={
"device" :"1780896723" # or device name
,"pin": "S1" #
,"CMD": "analogWrite"
,"aValue":"987"
,"sendORset":"setOnly"
}
)
plug.executeAction("sendPins",
props={
"device" :"megawifi" # or device id
,"pinsToBeSend": "s0,s1" #
}
)
Karl
some screen shots:
1. Indigo home menu with one Arduino device (an ESP) 2. Indigo device edit menu 3.Indigo menu: set Pins Values or Functions
old versions:
https://www.dropbox.com/s/fggk95nkax2om ... 7.zip?dl=1
https://www.dropbox.com/s/6lzekuz8aq56w ... 6.zip?dl=1
https://www.dropbox.com/s/tst9f446jti9y ... 3.zip?dl=1
https://www.dropbox.com/s/u3ybicflyf9qx ... 4.zip?dl=1
https://www.dropbox.com/s/rav1k0hwqcef5 ... 3.zip?dl=1
https://www.dropbox.com/s/ckawd05z0uitv ... 2.zip?dl=1
https://www.dropbox.com/s/domtlc32be8yc ... 2.zip?dl=0
https://www.dropbox.com/s/0ce31eztfo14p ... 1.zip?dl=1
https://www.dropbox.com/s/mm5ms63ed7n9s ... 2.zip?dl=1
https://www.dropbox.com/s/pmquegxsuv20m ... 2.zip?dl=1
https://www.dropbox.com/s/x1ka749or2sk7 ... 1.zip?dl=1
https://www.dropbox.com/s/gu989g4i1qk14 ... 1.zip?dl=1
https://www.dropbox.com/s/za40frsgxatmm ... 1.zip?dl=1
https://www.dropbox.com/s/saxut9b0ofpco ... o.zip?dl=1
https://www.dropbox.com/s/9pot8uja0hvk8 ... 1.zip?dl=1
https://www.dropbox.com/s/zfxokdozkjf06 ... 1.zip?dl=1