
Re: Weeder DIO with Serial Bridge
Hi Michael,
cme1ca wrote:Where is "wtdio" defined for when you poll the weeder board? Just running that will naturally error.
wtdio is the Serial Bridge connection name Tim used when he first created the connection. When you choose the
File->New Connection menu item in Serial Bridge it will prompt you for a connection name. To use Tim's script unmodified, enter "wtdio" in that Save As dialog.
Next, make sure in the connection window that appears you have the correct serial port, baud rate, etc., selected.
Next, press the
Edit Script... button to edit the connection script that Serial Bridge will automatically launch when it runs for this port. This will open the Apple Script Editor with an example script template. You'll want to copy/paste Tim's original script (second post above) into this file. Just delete everything currently in the file and replace it with Tim's script. Press the Compile button to make sure it got copied in correctly (check for errors), then Save and quite out of the Script Editor. Actually, before you save and quit, look at the strings the script sends at the top of the
startCommunication() function. You might want to edit those based on your Weeder board input/output configuration? Not sure...
Back in Serial Bridge now you'll want to press the
Reload Script button to have Serial Bridge pull in and start executing the script you just pasted in. Watch SB's Event Log window to make sure there aren't errors. Also check the
Script Status field in the connection window to make sure it stays running.
Now open the Variable window inside of Indigo. As input changes come in from the Weeder board the Serial Bridge AppleScript looks like it will automatically create and update Indigo Variables for each input. From there you can create Trigger Actions whenever a variable changes.
To poll the analog inputs from the Weeder it looks like Tim is sending the string "BS" to the weeder board every hour (his first script in the 5th post on this forum thread). To use that Script create a Time/Date Action in Indigo that repeats every 1 hour (or however often you need), set the action type to
Execute AppleScript and copy/paste the script contents into the embedded text field.