scargill Posted September 11, 2017 Share Posted September 11, 2017 Hi Can someone help. I have the current "legacy" ubuntu for Orange Pi Plus 2E - installed this morning. Everything seems fine except - I cannot figure out how to enable the serial port ttyS0 for general use - the console keeps grabbing it - I tried altering the boot cmd from console=both to console=tty1 - and I recompiled that as per the instructions - no difference - I can see on boot up that it is setting up ttys0 for debugging - and when I try to enable and then use it in Node-Red - it works at first - then some debug info comes in - and Node-Red loses control of the serial port. Can anyone help - also - SURELY there is more than one serial port on this board? The connector suggests at least 3 - but only ttyS0 is showing up in /dev - ideas? (without recompiling the entire operating system)? Link to comment Share on other sites More sharing options...
martinayotte Posted September 11, 2017 Share Posted September 11, 2017 Even if you change the boot.cmd, this will only affect the kernel output, but u-boot will still output stuff on that serial port. To use other serial ports, you simple need to turn them on by using overlays. To do so, add the following in /boot/armbianEnv.txt : overlays=uart1 uart2 uart3 ... and then reboot ... Link to comment Share on other sites More sharing options...
zador.blood.stained Posted September 11, 2017 Share Posted September 11, 2017 12 minutes ago, martinayotte said: To do so, add the following in /boot/armbianEnv.txt : overlays=uart1 uart2 uart3 ... and then reboot ... This is only for the mainline/dev images Link to comment Share on other sites More sharing options...
martinayotte Posted September 11, 2017 Share Posted September 11, 2017 2 minutes ago, zador.blood.stained said: This is only for the mainline/dev images I always forget about that, since I always running Mainline ... Link to comment Share on other sites More sharing options...
zador.blood.stained Posted September 11, 2017 Share Posted September 11, 2017 For the 3.4.x/legacy /boot/script.bin needs to be decompiled to FEX, edited and recompiled back. To prevent losing the changes on upgrades, /boot/script.bin symlink should be replaced with an actual file. Link to comment Share on other sites More sharing options...
scargill Posted September 12, 2017 Author Share Posted September 12, 2017 Thank you... Well I clicked on LEGACY for this board as that's the only one I could find on the Armbian site (Orange Pi Plus 2E) - please point me elsewhere if I picked the wrong one - however - your fixes worked. I had already had a go with the FEL editor - not having a clue what I was doing - simply setting the current 0 setting for the 3 serial ports to 1 - but that didn't work (it did result in a WHOLE boatload of serial ports however, appearing in DEV) But just adding in the setting you both provided - works a treat - all 3 ports work and I can forget about the debug port - though it really would be good to know how to turn that debug off on port 0 - utterly wasted for me, once I'm up and running. Link to comment Share on other sites More sharing options...
scargill Posted September 12, 2017 Author Share Posted September 12, 2017 Erm I wonder if I can push my luck - the Serial is all working now... but when I come to look at I2c - (i2cdetect) only I2c 0 is there... and that appears to be pins 3 and 5 on the 40 way connector - but taking my SSD1306 display (I put them on all my boards with a little Python driver) - and plugging it in - nothing is showing on port 3c.... unusual... any thoughts? Link to comment Share on other sites More sharing options...
martinayotte Posted September 12, 2017 Share Posted September 12, 2017 Is the SSD1306 appear when doing "i2cdetect -y 0" ? For the other I2C buses, did you enabled them in the FEX ? Link to comment Share on other sites More sharing options...
scargill Posted September 12, 2017 Author Share Posted September 12, 2017 27 minutes ago, martinayotte said: Is the SSD1306 appear when doing "i2cdetect -y 0" ? For the other I2C buses, did you enabled them in the FEX ? Hi there - no it is not appearing - but usually I use I2c1 - and there you have hit my limit - I have NO idea how to use that FEX - indeed I found an editor in the config and now I can't find that - but no I have not enabled them in FEX - it would be nice to enable i2c1 - ???? Link to comment Share on other sites More sharing options...
martinayotte Posted September 12, 2017 Share Posted September 12, 2017 Here is a FEX Guide : http://linux-sunxi.org/Fex_Guide In summary, you need to first do a backup of /boot/script.bin, then decompile in with "bin2fex /boot/script.bin > /tmp/script.fex", then edit the /tmp/script.fex to enable other I2C or UART, and finally recompile it using "fex2bin /tmp/script.fex > /boot/script.bin" Link to comment Share on other sites More sharing options...
scargill Posted September 12, 2017 Author Share Posted September 12, 2017 [twi0_para] twi0_used = 1 twi0_scl = port:PB00<2><default><default><default> twi0_sda = port:PB01<2><default><default><default> Also one for twi1_para - and a twi_para - I set all 3 to 1 - recompiled - rebooted - no difference whatsoever... still - at least now i know how to manipulate that file... I don't think it has done anything though... the script.bin file has definitely been updated... Link to comment Share on other sites More sharing options...
scargill Posted September 12, 2017 Author Share Posted September 12, 2017 HOWEVER Adding these following your earlier example overlays=i2c1 overlays=i2c0 Has moved an ugly UU entry to i2c1 - and my device now appears on i2c0 - - and..... the display WORKS - Wheeeeeeee. Thanks! Link to comment Share on other sites More sharing options...
scargill Posted September 12, 2017 Author Share Posted September 12, 2017 Groan... but now the serial doesn't work any more (write error despite permissions being fine)... I think altering the FEL file might've done that as the serial overlays are still there... permissions look ok too. Link to comment Share on other sites More sharing options...
martinayotte Posted September 12, 2017 Share Posted September 12, 2017 As Zador said, overlays only work on Mainline, not on Legacy ... Can you confirm which kernel are you using by doing "uname -a" ? 59 minutes ago, scargill said: twi0_scl = port:PB00<2><default><default><default> twi0_sda = port:PB01<2><default><default><default> That is strange : PBxx doesn't exist on H3 processor. TWI0 is using PA11/PA12 TWI1 is using PA18/PA19 TWI2 is using PE12/PE13 Link to comment Share on other sites More sharing options...
scargill Posted September 12, 2017 Author Share Posted September 12, 2017 Ok, I got it - all on one line... overlays=uart1 uart2 uart3 i2c0 i2c1 Even the unused UU has disappeared - and all is well. Link to comment Share on other sites More sharing options...
martinayotte Posted September 12, 2017 Share Posted September 12, 2017 The UU means that this device is in use by a dedicated driver. Probably that was the PMIC, so I don't understand why it disappeared ... Again, can you confirm which kernel are you using by doing "uname -a" ? Link to comment Share on other sites More sharing options...
scargill Posted September 13, 2017 Author Share Posted September 13, 2017 Sorry about the delay - sleep (UK) Linux plus2e 4.11.5-sun8i #11 SMP Fri Jun 23 20:03:23 CEST 2017 armv7l armv7l armv7l GNU/Linux Link to comment Share on other sites More sharing options...
scargill Posted September 13, 2017 Author Share Posted September 13, 2017 I may be being thick but when I went here... https://www.armbian.com/orange-pi-plus-2e/ All I'm seeing is 2 large "legacy" buttons so I assumed that is all there is for this board. Link to comment Share on other sites More sharing options...
Igor Posted September 13, 2017 Share Posted September 13, 2017 1 hour ago, scargill said: All I'm seeing is 2 large "legacy" buttons so I assumed that is all there is for this board. That is alright. We are waiting for 4.13.x kernel to become matured enough. Then we will promote its usage with a big button ... support could burst into flames if we decide to promote unfinished products to end users. Even finished products are hard and costly to support. Link to comment Share on other sites More sharing options...
Igor Posted September 13, 2017 Share Posted September 13, 2017 @scargill Pete, try this image: https://dl.armbian.com/orangepiplus2e/Ubuntu_xenial_next_nightly.7z It's 4.13.1 (first common image), still considered a testing one, but it works quite well. Go to armbian-config -> Armbian -> Overlays, choose function, press Save and go back. It will prompt for reboot ... It's tested for enabling audio via this menu and it worked after reboot. If you plan to use this image more seriously, freeze kernel update. Also from the menu. Link to comment Share on other sites More sharing options...
Recommended Posts