İyi günler Çağatay,
With ssh: other than @Maximilian-Gerhardt's share, you can use paswordless ssh key pair.
http://community.onion.io/topic/2903/how-to-generate-a-pair-of-keys-on-omega-2/2
in this link you can create a pair of paswordless key and just type
ssh root@my-omega-ip "./myProgram"
from your computer.
without ssh:
You can use usbttl adapter on rx0, tx0 and geather the console of omega2 for whatever you want to do.
You can use crontab -e and use cron for an application.
You can use rc.local or init.d that triger an application or script on boot time.
https://docs.onion.io/omega2-docs/running-a-command-on-boot.html
triggered application should in a loop, for example;
while read -r line < /dev/ttyS1; do
echo -e "$line"
done
this script wait a connection to gpio46,45 -> rx1, tx1 on Omega2 and runs forever.
#!/bin/sh /etc/rc.common
# Copyright (C) 2017 Onion Corporation
START=80
USE_PROCD=1
# PROCD_DEBUG=1
BIN="sh /root/bin/myProgram.sh"
start_service() {
# for i in /tmp/mounts/*; umount $i; done
/root/bin/fsck_record_disk.sh
procd_open_instance
procd_set_param command $BIN
procd_set_param respawn
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param pidfile /var/run/service.pid
procd_close_instance
}
this init.d script start on boot time and respawn whenever it's crash.
You can use any gpio pin for a push button and after the button pushed an application can be triggered.
Thats all on my mind.
Kolay gelsin.
P.S : If your program have while loop or something similar you should end your command with "&"
ssh root@my-omega-ip "./myProgram &"
without "&" your ssh connection will be stuck until kill the myProgram from Omega2's side.