@crispyoz Is the logger I have not a good enough logging?
How can I determine when the script shoudl be ran?
@crispyoz Is the logger I have not a good enough logging?
How can I determine when the script shoudl be ran?
@crispyoz I had this script and sometimes it runs sometimes it does not, could it be a physical issue with the cable? I do also have another label 10 script so not sure if thats what messes it up since they both have the same priority for execution? I am still unfamiliar with that, i understand lower numbers get priority execution but not much more.
#!/bin/sh
# Hotplug script for iPhone tethering
#/etc/hotplug.d/usb/10-iphone-tethering
if [ "$ACTION" = "add" ]; then
logger "iPhone detected, PRODUCT=$PRODUCT, bringing up eth1"
sleep 2
ifconfig eth1 up
udhcpc -i eth1
fi
/etc/hotplug.d/usb$ ls
10-iphone-tethering 20-usb_mode
10-motion 22-qmi_wwan
I am succesfully running internet tethering via my iPhone 14. However, everytime I plug it in I have to run these commands to get the network going and give it an ip address:
ifconfig eth1 up
udhcpc -i eth1
How can I have a shell script or something like that run these two commands everytime I get my iPhone plugged in.
These are the connection logs:
[ 2672.632679] ipheth 1-1.3:4.2: Apple iPhone USB Ethernet device attached
[ 2672.361490] usb 1-1.3: new high-speed USB device number 14
I already had usbutils loaded but here is the output
opkg install usbutils
Package usbutils (014-1) installed in root is up to date.
root@Omega-7E26:/# lsusb -v
Bus 002 Device 001: ID 1d6b:0001 Linux 5.10.146 ohci_hcd Generic Platform OHCI controller
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 9
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x1d6b
idProduct 0x0001
bcdDevice 5.10
iManufacturer 3 Linux 5.10.146 ohci_hcd
iProduct 2 Generic Platform OHCI controller
iSerial 1 101c1000.ohci
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0019
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0002 1x 2 bytes
bInterval 255
Hub Descriptor:
bLength 9
bDescriptorType 41
nNbrPorts 1
wHubCharacteristic 0x0008
Ganged power switching
Per-port overcurrent protection
bPwrOn2PwrGood 2 * 2 milli seconds
bHubContrCurrent 0 milli Ampere
DeviceRemovable 0x00
PortPwrCtrlMask 0xff
Hub Port Status:
Port 1: 0000.0100 power
Device Status: 0x0001
Self Powered
Bus 001 Device 001: ID 1d6b:0002 Linux 5.10.146 ehci_hcd EHCI Host Controller
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 9
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x1d6b
idProduct 0x0002
bcdDevice 5.10
iManufacturer 3 Linux 5.10.146 ehci_hcd
iProduct 2 EHCI Host Controller
iSerial 1 101c0000.ehci
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0019
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 12
Hub Descriptor:
bLength 9
bDescriptorType 41
nNbrPorts 1
wHubCharacteristic 0x0009
Per-port power switching
Per-port overcurrent protection
bPwrOn2PwrGood 10 * 2 milli seconds
bHubContrCurrent 0 milli Ampere
DeviceRemovable 0x00
PortPwrCtrlMask 0xff
Hub Port Status:
Port 1: 0000.0100 power
Device Status: 0x0001
Self Powered
When plugging in my usb drive it wont be registered or come up in the messages or console outputs. When I plug in my keyboard I get this. Not sure where to go from hre. I just flashed in the latest image from here
http://repo.onioniot.com/omega2/images/
and gave it the following packages
opkg install kmod-usb-net-rndis
opkg install kmod-nls-base kmod-usb-core kmod-usb-net kmod-usb-net-cdc-ether kmod-usb2
kmod-usb-ohci kmod-usb-uhci kmod-usb-storage libusbmuxd
opkg install kmod-usb-net-ipheth usbmuxd libimobiledevice usbutils
I had another opnion that wont boot anymore (voltage going trhough but I dont see any output in teminal when accessing via serial) that used to work with this but this one won't
] usb 2-1: device descriptor read/64, error -62
[ 146.282419] usb 2-1: device descriptor read/64, error -62
[ 146.612390] usb 2-1: new low-speed USB device number 3 using ohci-platform
[ 146.832422] usb 2-1: device descriptor read/64, error -62
[ 147.162386] usb 2-1: device descriptor read/64, error -62
[ 147.282481] usb usb2-port1: attempt power cycle
[ 147.552426] usb 2-1: new low-speed USB device number 4 using ohci-platform
[ 147.992377] usb 2-1: device not accepting address 4, error -62
[ 148.202447] usb 2-1: new low-speed USB device number 5 using ohci-platform
[ 148.642381] usb 2-1: device not accepting address 5, error -62
[ 148.648412] usb usb2-port1: unable to enumerate USB device
@luz hahaha, trying to become a full onioneer little by little.
It is the Omega2+. Here is a log of the boot process to see if I'm missing anything.
U-Boot 2024.04-gc2bfb2b8c6 (Jul 19 2024 - 15:18:23 -0400)
CPU: MediaTek MT7688A ver:1 eco:2
Boot: DDR2, SPI-NOR 3-Byte Addr, CPU clock from XTAL
Clock: CPU: 580MHz, Bus: 193MHz, XTAL: 40MHz
Model: Onion Omega2+
DRAM: 128 MiB
Core: 59 devices, 18 uclasses, devicetree: separate
Loading Environment from SPIFlash... SF: Detected mx25l25635e with page size 256 Bytes, erase size 64 KiB, total 32 MiB
OK
In: uartlite@c00
Out: uartlite@c00
Err: uartlite@c00
Initializing MT7688 GPIO system.
Net: eth0: eth@10110000
Hit any key to stop autoboot: 0
=>
I did see that address 80800000 is outside the zone range of the memory but the load address is defined as 0x80800000 and trying to load it via tftp and booting anywhere else fails to decompress the image. Maybe thats the issue and just assumed it should work. Thought the offset would take care of that but maybe I am misunderstanding what the offset does
CONFIG_SYS_LOAD_ADDR=0x80800000
This is the update for the OnionIOT bootloader :
https://github.com/u-boot/u-boot/compare/master...OnionIoT:u-boot:feature/update-version-1
Hello all,
I am trying the new updates to the OnionIOT bootloader from thier repo that support DTS and FIT. I loaded the bootloader into my onion and it boots fine. However, when I try and boot my image (via tftp since because I wiped the memory of the onion) ot gets stuck at the same line after decompressing the image. Here are some logs of the process:
U-Boot 2024.04-gc2bfb2b8c6 (Jul 19 2024 - 15:18:23 -0400)
CPU: MediaTek MT7688A ver:1 eco:2
Boot: DDR2, SPI-NOR 3-Byte Addr, CPU clock from XTAL
Clock: CPU: 580MHz, Bus: 193MHz, XTAL: 40MHz
Model: Onion Omega2+
DRAM: 128 MiB
Core: 59 devices, 18 uclasses, devicetree: separate
Loading Environment from SPIFlash... SF: Detected mx25l25635e with page size 256 Bytes, erase size 64 KiB, total 32 MiB
OK
In: uartlite@c00
Out: uartlite@c00
Err: uartlite@c00
Initializing MT7688 GPIO system.
Net: eth0: eth@10110000
Hit any key to stop autoboot: 0
=> tftp 80800000 omega-firm.bin
Using eth@10110000 device
TFTP from server 192.168.8.100; our IP address is 192.168.8.8
Filename 'omega-firm.bin'.
Load address: 0x80800000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
###########
737.3 KiB/s
done
Bytes transferred = 9699509 (9400b5 hex)
=> printenv
baudrate=115200
bootargs=console=ttyS0,115200 rootfstype=squashfs,jffs2
bootcmd=sf probe && mtd read firmware 82000000 && bootm 82000000
bootdelay=2
ethact=eth@10110000
ethaddr=a6:91:42:0b:06:7c
fdtcontroladdr=87e7a3f0
fileaddr=80800000
filesize=9400b5
ipaddr=192.168.8.8
loadaddr=0x80800000
mtdparts=spi0.0:512k(factory-uboot),64k(config),64k(factory),1408k(firmware)
serverip=192.168.8.100
stderr=uartlite@c00
stdin=uartlite@c00
stdout=uartlite@c00
Environment size: 452/16380 bytes
=> bootm 80800000 - 87e7a3f0
## Booting kernel from Legacy Image at 80800000 ...
Image Name: MIPS OpenWrt Linux-4.14.81
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1617403 Bytes = 1.5 MiB
Load Address: 80000000
Entry Point: 80000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 87e7a3f0
Booting using the fdt blob at 0x87e7a3f0
Working FDT set to 87e7a3f0
Uncompressing Kernel Image to 80000000
Loading Device Tree to 87e73000, end 87e77ae7 ... OK
Working FDT set to 87e73000
[ 0.000000] Linux version 4.14.81 (root@bd1394bc994b) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r0+7489-5689a685d1)) #0 Wed Apr 21 22:49:55 2021
[ 0.000000] Board has DDR2
[ 0.000000] Analog PMU set to hw control
[ 0.000000] Digital PMU set to hw control
[ 0.000000] SoC Type: MediaTek MT7688 ver:1 eco:2
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 00019655 (MIPS 24KEc)
[ 0.000000] MIPS: machine is Onion Omega2+
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 08000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000000000000-0x0000000007ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x0000000007ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[ 0.000000] random: get_random_bytes called from start_kernel+0x8c/0x474 with crng_init=0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 32512
[ 0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
[ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Writing ErrCtl register=0007d7a4
[ 0.000000] Readback ErrCtl register=0007d7a4
[ 0.000000] Memory: 124580K/131072K available (3708K kernel code, 207K rwdata, 920K rodata, 212K init, 205K bss, 6492K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 256
[ 0.000000] intc: using register map from devicetree
[ 0.000000] CPU Clock: 580MHz
[ 0.000000] timer_probe: no matching timers found
[ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[ 0.000012] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[ 0.008029] Console: colour dummy device 80x25
[ 0.012487] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[ 0.074142] pid_max: default: 32768 minimum: 301
[ 0.079046] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.085689] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.100039] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.109986] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.116208] pinctrl core: initialized pinctrl subsystem
[ 0.122017] NET: Registered protocol family 16
[ 0.158437] mt7621_gpio 10000600.gpio: registering 32 gpios
[ 0.164372] mt7621_gpio 10000600.gpio: registering 32 gpios
[ 0.170148] mt7621_gpio 10000600.gpio: registering 32 gpios
[ 0.177021] i2c-mt7621 10000900.i2c: clock 100 kHz
[ 0.186788] clocksource: Switched to clocksource MIPS
[ 0.199246] NET: Registered protocol family 2
[ 0.204575] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.211638] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.218029] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.224583] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.230481] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.237070] NET: Registered protocol family 1
[ 0.256017] Crashlog allocated RAM at address 0x3f00000]
@crispyoz Sorry for the time it took me to reply, I got it working in my docker and it works well enough but thanks for the help
@crispyoz I am struggling a bit as I am not entirely sure what the error is coming from. I get a couple initial warnings saying dependenceis need nodejs but I do have nodejs istalled. Do you by any chance do anythign different from the Onion's repo?
@crispyoz Thanks once again. Have you built the docker yourself for the firmware image or went nother route? Not sure if you also experienced connectivity issues with the docker attempting to update the feeds
@crispyoz Thank you for your help. do you know if those can be edited after flash or it has to be done upon build?
Hello everyone. I was wondering if anyone has been able to remake or redraw the memory partitions on the onion. I want a bigger bootloader partition for a costumized uboot image I made. I just need around 300-350 kb whereas the original is around 192. Any help would be greatly appreciated so I dont brick too many onoins lol.
@crispyoz said in u-boot binary too large on compile:
I did succesfully compile that one before but dont see a defconfig file for me to edit and play with, which is why I was using the other git repo. Am I incorrect there and there is a defconfig file I can edit? I found nothing from a find command.
I am trying to compile basic u-boot binaries using the configuration from here:
https://github.com/OnionIoT/u-boot/blob/master/configs/onion-omega2p_defconfig
I am able to succesfully compile the make but get a u-boot.bin much larger than expected. I get a u-boot.bin of 487 kb while most images i found from the Onion are arond 170 kb. Moreover the Onion has a 192kb max sixe for the bootloader so was wondering if anyone could help me in the right direction. Any help would be greatly appreciated
Here are the steps i took in Ubuntu 22.04.04
sudo apt-get update
sudo apt-get install build-essential libncurses5-dev bc gcc-multilib
Wget https://downloads.openwrt.org/releases/21.02.3/targets/ramips/mt76x8/openwrt-sdk-21.02.3-ramips-mt76x8_gcc-8.4.0_musl.Linux-x86_64.tar.xz
tar -xvf openwrt-sdk-21.02.3-ramips-mt76x8_gcc-8.4.0_musl.Linux-x86_64.tar.xz
cd openwrt-sdk-21.02.3-ramips-mt76x8_gcc-8.4.0_musl.Linux-x86_64
export STAGING_DIR=$(pwd)/staging_dir
export PATH=$PATH:$STAGING_DIR/toolchain-mipsel_24kc_gcc-8.4.0_musl/bin
export CROSS_COMPILE=mipsel-openwrt-linux-
git clone https://github.com/OnionIoT/u-boot.git
cd u-boot/
make onion-omega2p_defconfig
Make
@luz Thank you very much for your help I did start creating the uImages shortly after this since I was getting a Bad Magic Number but was unsure why/how until reading your post. Currently trying to create the correct uImage as I'm unsire if my current errors come from pointing in the wrong memory load adress or empty points. Still relatively new to this but I appreciate the help
I am trying to copy my bootloader (mtd0) and replace the kernel (mtd4) I know this will render the Onion "unusable", but I want to do that to have a secondary bootloader to edit and have the primary bootloader still available for if/when i brick a bootloader trying to change it and compiling.
Regardless on if I try to copy the actual u-boot itself or the given binaries from the official repo I get a permision denied error.
If anyone knows of how to give myself the correct permissions that would be great, or maybe a way to do it on a lower level such as bootloader mode.
root@Omega-8279:/# dd if=uboot-omega2p-20200512.bin of=/dev/mtd4 bs=4096
dd: can't open '/dev/mtd4': Permission denied
root@Omega-8279:/# dd if=/dev/mtd0 of=/dev/mtd4 bs=4096
dd: can't open '/dev/mtd4': Permission denied
crw-r-xr-x 1 root root 90, 8 Jan 1 1970 /dev/mtd4