Cant speak much to installing sshpass. But why not use ssh key based access with clear keys? That way you can establish ssh without a password and its quite alot more secure than using a password. Plus its natively supported by dropbear ssh installed on the onion by default.
Posts made by UFD
-
RE: How install sshpass in Omega2+?
-
RE: Omega2S+ SW_RST Clarification?
Just to add on, you should tie it to ground if you are not planning on using it. However, it is worthwhile to note that this pin is quite important when trying to do serial recovery procedure or manual flash using usb as you need to hold this button on power up.
Always good practice to at least have provisions for a jumper or something if the need arises.
-
RE: Using uci-defaults scripts
For the interested:
I found that MAC can also be obtained on a more lower level:hexdump -s 4 -n 6 /dev/mtd2 | sed -n '1p' | awk '{print substr($2,3) substr($2,1,2) substr($3,3) substr($3,1,2) substr($4,3) substr($4,1,2)}'
as seen in the ethernet-mode init.d script
-
RE: Using uci-defaults scripts
Thanks @crispyoz.
I have tried this workaround but i must have done something wrong as my file did not seem to want to run.
Another workaround I did however findis to use the ethernet mac address and derive the wifi one in the uci script. Seems the ra0 interface mac is only available once the wifi drivers are loaded which seems to be after uci-defaults scripts. however ethernet MAC is available and wifi mac can be derived by subtracting 1.
My updated script as shared before is now:
#!/bin/sh # Script to update MAC in mosquitto configuration echo "Get uppercase WiFi MAC address without colons from system config" EMAC=$(cat /sys/class/net/eth0/address | sed s/://g | sed y/[abcdef]/[ABCDEF]/) WMAC=$(printf "%X" $((0x${EMAC} - 1))) echo "Configuring Mosquitto (/etc/mosquitto/mosquitto.conf) with $WMAC" #replace the placeholder <MAC> in the file with the actual WMAC address sed -i "s/<MAC>/$WMAC/" /etc/mosquitto/mosquitto.conf exit 0
It will however continue to bug me as to why the original uci script did not work... I wonder how the omega onion official 13_hostname is actually doing anything when I overwrite this file with a debug version to print its mac also shows up as 00:00:00:00:00:00.
Maybe we will never know.
Thanks.
-
Using uci-defaults scripts
I have used uci-defaults script in my image creation to setup some parameters on my onion. However one setup set that requires the devices MAC has me stumped. I need to echo the MAC into a mosquitto mqtt configuration file so I have setup a uci script called "52_mosquitto_config"
#!/bin/sh # Script to update MAC in mosquitto configuration echo "Get uppercase MAC address without colons from system config" MAC=$(cat /sys/class/net/ra0/address | sed s/://g | sed y/[abcdef]/[ABCDEF]/) echo "Configuring Mosquitto (/etc/mosquitto/mosquitto.conf) with $MAC" #replace the placeholder <MAC> in the file with the actual MAC address sed -i "s/<MAC>/$MAC/" /etc/mosquitto/mosquitto.conf exit 0
however this always results in a my placeholder "<MAC>" being replaced with "000000000000".
This led me to the conclusion that the file /sys/class/net/ra0/address is returning 00:00:00:00:00:00 at the point that uci is running.
However in uci-defaults/ file "13_hostname" they clearly use the same file to set hostname:
m1=$(cat /sys/class/net/ra0/address | awk -F':' '{ print $5 }' | awk '{print toupper($0)}') m2=$(cat /sys/class/net/ra0/address | awk -F':' '{ print $6 }' | awk '{print toupper($0)}')
My understanding of uci-defaults is that they are run sequentially based on name.
Why does mac return a valid response for script 13_hostname and not for me in 52_mosquitto_config?
Any help always appreciated.
Thanks.
-
RE: onion omega 2. Two or more ethernet expansions
I've never tried it, but you could possibly use a USB to Ethernet adaptor to add additional Ethernet Ports.
-
RE: Raspberry pi project replace with omega possible or not
Since u have an existing implementation on the rpi, you should be able to check how much ram, cpu, and disk ur application requires.
-
RE: Raspberry pi project replace with omega possible or not
Yip, i dont see anyreason why not. I always suggest you start with the omega 2+ as it has more space.
-
RE: Omega 2S Ethernet Vnet Connection
Thanks @György-Farkas and @crispyoz for the confirmation.
I have seen the 2S reference but just wanted to make sure before I spin out a PCB as there is a discrepancy with the 2/+.
-
Omega 2S Ethernet Vnet Connection
Good Day,
I would like to seek clarity on connecting an Ethernet port to the Omega 2S.
On the 2+ I have connected the center tap of the Ethernet transformer to pin Vnet on the onion 2/+ (labeled 3.3V OUT located next to FW_RST pin) as per the expansion dock schematic:
The Onion 2S/+ does not have a 3.3V out pin. According to the refereance schematics for the 2S this center tap on the ethernet port seems to be floating or not connected. Is this the correct configuration? or should I tie it up to 3.3V rail?
Thanks.
UFD -
RE: Omega 2S WiFi Antenna Design
Thanks will certainly consider the chip option.
I'll also try and copy the trace antenna from the dev board image as best as possible and compare results.
-
Omega 2S WiFi Antenna Design
Hi,
I have not found a good wifi antenna reference when designing a pcb for the omega onion 2s/+.
Would someone be able to recommend/advise on possible PCB trace schematics/designs as im looking to keep cost down.
Does the 2S dev board have a 0 (Zero) Ohm resistor connected to the Ant pin? What is the purpose of this?
Thanks,
UFD -
RE: Run a program(python code) in Omega 2+ when it's power on
Most certainly, The onion runs openwrt which is a linux system.
lookup "cron/crontab" or "init.d" either of these will allow you to achieve your goal.
-
RE: Onion Omega2S Memory issue
I do not have the 2S but according to the specs it only has 16MB
This seems to be split across rom and overlay. The Onion 2S+ has double the space.
-
RE: Cloning one onion to another
@Joshua-O-Leary , start off with creating a firmware image from source code that u can flash onto ur onion.
The instructions are on the source code repository:
https://github.com/OnionIoT/sourceOnce you have this working, adding files is trivial.
Good Luck
-
RE: I2S ADC Headaches
@zazu-z , Its only because I've spend the last 6 months trying to figure it out. I've also found value in the forum and therefore Im always happy to give back.
The solution is not perfect and I am actually experiencing alsa overrun issues when recording. In my books it's still a challenge that needs a fully understood solution. -
RE: I2S ADC Headaches
Hey @zazu-z , indeed @luz is correct.
You will need to add the config to target/linux/ramips/modules.mk
At the end of the file my changes are as follows:
define KernelPackage/sound-mt7620 TITLE:=MT7620 PCM/I2S Alsa Driver DEPENDS:=@TARGET_ramips +kmod-sound-soc-core +kmod-regmap +kmod-dma-ralink @!TARGET_ramips_rt288x KCONFIG:= \ CONFIG_SND_RALINK_SOC_I2S \ CONFIG_SND_SIMPLE_CARD \ CONFIG_SND_SIMPLE_CARD_UTILS \ CONFIG_SND_SOC_SPDIF FILES:= \ $(LINUX_DIR)/sound/soc/ralink/snd-soc-ralink-i2s.ko \ $(LINUX_DIR)/sound/soc/generic/snd-soc-simple-card.ko \ $(LINUX_DIR)/sound/soc/generic/snd-soc-simple-card-utils.ko \ $(LINUX_DIR)/sound/soc/codecs/snd-soc-spdif-rx.ko \ $(LINUX_DIR)/sound/soc/codecs/snd-soc-spdif-tx.ko AUTOLOAD:=$(call AutoLoad,90,snd-soc-spdif-rx snd-soc-spdif-tx snd-soc-ralink-i2s snd-soc-simple-card) $(call AddDepends/sound) endef define KernelPackage/sound-mt7620/description Alsa modules for ralink i2s controller. endef
If I recall correctly the above can also more correctly be achieved by doing a:
make kernel_menuconfig
And enabling the SPDIF module in:
Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> ALSA for SoC audio support -> CODEC drivers
Hope that helps.
Regards,
UFD -
RE: bluetoothctl Omega2Plsu
Hi @Velera-OKON,
@crispyoz is correct, you need to enable opkg feeds for openwrt_base and openwrt_packages here is a working log from a fresh image:
root@Omega-XXXX:~# vi /etc/opkg/distfeeds.conf root@Omega-XXXX:~# cat /etc/opkg/distfeeds.conf #src/gz openwrt_core http://downloads.openwrt.org/releases/18.06-SNAPSHOT/targets/ramips/mt76x8/packages src/gz openwrt_base http://downloads.openwrt.org/releases/18.06-SNAPSHOT/packages/mipsel_24kc/base #src/gz openwrt_luci http://downloads.openwrt.org/releases/18.06-SNAPSHOT/packages/mipsel_24kc/luci #src/gz openwrt_onion http://downloads.openwrt.org/releases/18.06-SNAPSHOT/packages/mipsel_24kc/onion src/gz openwrt_packages http://downloads.openwrt.org/releases/18.06-SNAPSHOT/packages/mipsel_24kc/packages #src/gz openwrt_routing http://downloads.openwrt.org/releases/18.06-SNAPSHOT/packages/mipsel_24kc/routing #src/gz openwrt_telephony http://downloads.openwrt.org/releases/18.06-SNAPSHOT/packages/mipsel_24kc/telephony src/gz omega2_core http://repo.onioniot.com/omega2/packages/core src/gz omega2_base http://repo.onioniot.com/omega2/packages/base src/gz omega2_packages http://repo.onioniot.com/omega2/packages/packages src/gz omega2_routing http://repo.onioniot.com/omega2/packages/routing src/gz omega2_onion http://repo.onioniot.com/omega2/packages/onion root@Omega-XXXX:/etc/opkg# opkg update Downloading http://downloads.openwrt.org/releases/18.06- SNAPSHOT/packages/mipsel_24kc/base/Packages.gz Updated list of available packages in /var/opkg-lists/openwrt_base Downloading http://downloads.openwrt.org/releases/18.06-SNAPSHOT/packages/mipsel_24kc/base/Packages.sig Signature check passed. Downloading http://downloads.openwrt.org/releases/18.06-SNAPSHOT/packages/mipsel_24kc/packages/Packages.gz Updated list of available packages in /var/opkg-lists/openwrt_packages Downloading http://downloads.openwrt.org/releases/18.06-SNAPSHOT/packages/mipsel_24kc/packages/Packages.sig Signature check passed. Downloading http://repo.onioniot.com/omega2/packages/core/Packages.gz Updated list of available packages in /var/opkg-lists/omega2_core Downloading http://repo.onioniot.com/omega2/packages/core/Packages.sig Signature check passed. Downloading http://repo.onioniot.com/omega2/packages/base/Packages.gz Updated list of available packages in /var/opkg-lists/omega2_base Downloading http://repo.onioniot.com/omega2/packages/base/Packages.sig Signature check passed. Downloading http://repo.onioniot.com/omega2/packages/packages/Packages.gz Updated list of available packages in /var/opkg-lists/omega2_packages Downloading http://repo.onioniot.com/omega2/packages/packages/Packages.sig Signature check passed. Downloading http://repo.onioniot.com/omega2/packages/routing/Packages.gz Updated list of available packages in /var/opkg-lists/omega2_routing Downloading http://repo.onioniot.com/omega2/packages/routing/Packages.sig Signature check passed. Downloading http://repo.onioniot.com/omega2/packages/onion/Packages.gz Updated list of available packages in /var/opkg-lists/omega2_onion Downloading http://repo.onioniot.com/omega2/packages/onion/Packages.sig Signature check passed. root@Omega-XXXX:/etc/opkg# opkg install bluez-libs Installing bluez-libs (5.49-1) to root... Downloading http://downloads.openwrt.org/releases/18.06- SNAPSHOT/packages/mipsel_24kc/packages/bluez-libs_5.49-1_mipsel_24kc.ipk Configuring bluez-libs. root@Omega-XXXX:/etc/opkg# opkg install bluez-utils Installing bluez-utils (5.49-1) to root... Downloading http://downloads.openwrt.org/releases/18.06-SNAPSHOT/packages/mipsel_24kc/packages/bluez-utils_5.49-1_mipsel_24kc.ipk Installing libffi (3.2.1-3) to root... Downloading http://repo.onioniot.com/omega2/packages/packages/libffi_3.2.1-3_mipsel_24kc.ipk Installing libattr (20170915-1) to root... Downloading http://repo.onioniot.com/omega2/packages/packages/libattr_20170915-1_mipsel_24kc.ipk Installing glib2 (2.58.1-2) to root... Downloading http://repo.onioniot.com/omega2/packages/packages/glib2_2.58.1-2_mipsel_24kc.ipk Installing libdbus (1.10.4-1) to root... Downloading http://repo.onioniot.com/omega2/packages/packages/libdbus_1.10.4-1_mipsel_24kc.ipk Installing dbus (1.10.4-1) to root... Downloading http://repo.onioniot.com/omega2/packages/packages/dbus_1.10.4-1_mipsel_24kc.ipk Configuring libffi. Configuring libattr. Configuring glib2. Configuring libdbus. Configuring dbus. Configuring bluez-utils. root@Omega-XXXX:/etc/opkg# bluetoothctl -ash: bluetoothctl: not found root@Omega-XXXX:/etc/opkg# opkg install bluez-daemon Installing bluez-daemon (5.49-1) to root... Downloading http://downloads.openwrt.org/releases/18.06-SNAPSHOT/packages/mipsel_24kc/packages/bluez-daemon_5.49-1_mipsel_24kc.ipk Installing libical (1.0-1) to root... Downloading http://downloads.openwrt.org/releases/18.06-SNAPSHOT/packages/mipsel_24kc/packages/libical_1.0-1_mipsel_24kc.ipk Configuring libical. Configuring bluez-daemon. root@Omega-XXXX:/etc/opkg# bluetoothctl Waiting to connect to bluetoothd...
Regards,
UFD -
RE: bluetoothctl Omega2Plsu
I recall this question asked about a year ago, seems no one responded:
http://community.onion.io/topic/2693/bluetoothctl-not-found
I think bluetoothctl might be part of package "bluez-daemon". can you try installing this?
Regadrs
UFD