×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Arduino Basic switcher interface

  • Posts: 50
  • Thank you received: 1
Hi everyones,

I am trying to connect an Arduino simple switcher with indi to controle some switchers on my observatory.

I sketch on a arduino one the StandardFirmata.ino file that i found on indi-3rdparty:
github.com/indilib/indi-3rdparty/tree/ma...ares/StandardFirmata

And after do this and connect relay board to the arduino board like said here:
indilib.org/develop/arduino/basic-switcher.html

I am trying to connect arduino board to INDI by Arduino simple switcher, but when i press connect dont do it, and i dont show any log, nothing.


On my pc with arduino boaord conected said:
sudo dmesg
93.759598] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 93.759651] ch341 1-3:1.0: device disconnected
[ 96.334326] usb 1-6: new full-speed USB device number 4 using xhci_hcd
[ 96.484162] usb 1-6: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.64
[ 96.484181] usb 1-6: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 96.484187] usb 1-6: Product: USB Serial
[ 96.486059] ch341 1-6:1.0: ch341-uart converter detected
[ 96.487228] usb 1-6: ch341-uart converter now attached to ttyUSB0

i attache some files on my indi driver interface

Somebody know how fix this problem?
or some alternative to connect some switcher on Ekos?
Thanks,
Regards.
3 months 3 weeks ago #100956
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 50
  • Thank you received: 1
Hi everyones,

I found this tutorial to create a custom device, but i dont know how to create my Standarfirmata Simple Switcher

indilib.org/develop/arduino/custom-device.html

This its the skeleton from /usr/share/indi/simple_switcher_sx.xml

<INDIDriver>
<defSwitchVector device="Arduino SWITCHER" name="CONNECTION" label="Connection" group="Main Control" state="Idle" perm="rw" rule="OneOfMany" timeout="60">
<defSwitch name="CONNECT" label="Connect">
Off
</defSwitch>
<defSwitch name="DISCONNECT" label="Disconnect">
On
</defSwitch>
</defSwitchVector>

<defSwitchVector device="Arduino SWITCHER" name="SOCKET 1" label="SOCKET 1" group="Main Control" state="Idle" perm="rw" rule="OneOfMany" timeout="1">
<defSwitch name="SOCKET01" label="ON">
<indiduino pin="2"/>
Off
</defSwitch>
<defSwitch name="DUMMY" label="OFF">
On
</defSwitch>
</defSwitchVector>

<defSwitchVector device="Arduino SWITCHER" name="SOCKET 2" label="SOCKET 2" group="Main Control" state="Idle" perm="rw" rule="OneOfMany" timeout="1">
<defSwitch name="SOCKET02" label="ON">
<indiduino pin="3"/>
Off
</defSwitch>
<defSwitch name="DUMMY" label="OFF">
On
</defSwitch>
</defSwitchVector>

<defSwitchVector device="Arduino SWITCHER" name="SOCKET 3" label="SOCKET 3" group="Main Control" state="Idle" perm="rw" rule="OneOfMany" timeout="1">
<defSwitch name="SOCKET03" label="ON">
<indiduino pin="4"/>
Off
</defSwitch>
<defSwitch name="DUMMY" label="OFF">
On
</defSwitch>
</defSwitchVector>

<defSwitchVector device="Arduino SWITCHER" name="SOCKET 4" label="SOCKET 4" group="Main Control" state="Idle" perm="rw" rule="OneOfMany" timeout="1">
<defSwitch name="SOCKET04" label="ON">
<indiduino pin="5"/>
Off
</defSwitch>
<defSwitch name="DUMMY" label="OFF">
On
</defSwitch>
</defSwitchVector>

<defSwitchVector device="Arduino SWITCHER" name="SOCKET 5" label="SOCKET 5" group="Main Control" state="Idle" perm="rw" rule="OneOfMany" timeout="1">
<defSwitch name="SOCKET05" label="ON">
<indiduino pin="6"/>
Off
</defSwitch>
<defSwitch name="DUMMY" label="OFF">
On
</defSwitch>
</defSwitchVector>

<defSwitchVector device="Arduino SWITCHER" name="SOCKET 6" label="SOCKET 6" group="Main Control" state="Idle" perm="rw" rule="OneOfMany" timeout="1">
<defSwitch name="SOCKET06" label="ON">
<indiduino pin="7"/>
Off
</defSwitch>
<defSwitch name="DUMMY" label="OFF">
On
</defSwitch>
</defSwitchVector>

<defSwitchVector device="Arduino SWITCHER" name="SOCKET 7" label="SOCKET 7" group="Main Control" state="Idle" perm="rw" rule="OneOfMany" timeout="1">
<defSwitch name="SOCKET07" label="ON">
<indiduino pin="8"/>
Off
</defSwitch>
<defSwitch name="DUMMY" label="OFF">
On
</defSwitch>
</defSwitchVector>

<defSwitchVector device="Arduino SWITCHER" name="SOCKET 8" label="SOCKET 8" group="Main Control" state="Idle" perm="rw" rule="OneOfMany" timeout="1">
<defSwitch name="SOCKET08" label="ON">
<indiduino pin="9"/>
Off
</defSwitch>
<defSwitch name="DUMMY" label="OFF">
On
</defSwitch>
</defSwitchVector>

<defSwitchVector device="Arduino SWITCHER" name="SOCKET 9" label="SOCKET 9" group="Main Control" state="Idle" perm="rw" rule="OneOfMany" timeout="1">
<defSwitch name="SOCKET09" label="ON">
<indiduino pin="10"/>
Off
</defSwitch>
<defSwitch name="DUMMY" label="OFF">
On
</defSwitch>
</defSwitchVector>

<defSwitchVector device="Arduino SWITCHER" name="SOCKET 10" label="SOCKET 10" group="Main Control" state="Idle" perm="rw" rule="OneOfMany" timeout="1">
<defSwitch name="SOCKET10" label="ON">
<indiduino pin="11"/>
Off
</defSwitch>
<defSwitch name="DUMMY" label="OFF">
On
</defSwitch>
</defSwitchVector>

<defSwitchVector device="Arduino SWITCHER" name="SOCKET 11" label="SOCKET 11" group="Main Control" state="Idle" perm="rw" rule="OneOfMany" timeout="1">
<defSwitch name="SOCKET11" label="ON">
<indiduino pin="12"/>
Off
</defSwitch>
<defSwitch name="DUMMY" label="OFF">
On
</defSwitch>
</defSwitchVector>

<defSwitchVector device="Arduino SWITCHER" name="SOCKET 12" label="SOCKET 12" group="Main Control" state="Idle" perm="rw" rule="OneOfMany" timeout="1">
<defSwitch name="SOCKET12" label="ON">
<indiduino pin="13"/>
Off
</defSwitch>
<defSwitch name="DUMMY" label="OFF">
On
</defSwitch>

</defSwitchVector>
</INDIDriver>

I think i need to indicate the driver inside this xml file but i dont know how to do it.
somebody have a custom device and a skeleton working?

Thanks,
Regards.
3 months 2 weeks ago #100985

Please Log in or Create an account to join the conversation.

  • Posts: 50
  • Thank you received: 1
Finally i found a solution editing rolloffino driver, follow this link:

indilib.org/forum/domes/14742-solved-imp...i-driver.html#101068

I think its better solution, rollof ino comes default with only one auxiliary switcher, y improve a custom driver and i have 3 more switches.

Enjoy,
Regards.
3 months 2 weeks ago #101069

Please Log in or Create an account to join the conversation.

Time to create page: 0.372 seconds