• Posts

  • Joined

  • Last visited

Profile Information

  • Location
    Auckland New Zealand

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Elektrický's Achievements

  1. Hi @djurny, nice. I'm glad that you liked my tutorial. Re: "p.s. I still have to figure out why I needed this" I have the same issue, but I like building things and I like the idea of having really accurate time. I donated one to a friend in South Africa. They have rolling power cuts which takes out the internet for several hours at a time. He has a good UPS and some IoT devices that don't have real time clocks so they don't initialise properly without NTP time and he didn't have a suitable backup NTP server. Technical overkill, but still a very economic solution to his problem.
  2. Just add the server to your NTP client as you would any other NTP server. If you are using the Windows 10 OS then you can use the built in client. Open Control Panel Go to Clock, Language, and Region Click the icon Date and Time Open the tab named Internet Time Click the button named Change settings Tick Synchronize with internet time server Fill in the IP of your NTP server Click OK.
  3. Thanks @Guidol, I had the same issue with Orange Pi Zero Plus. One showed Cpu Temp And Cpu Frequency. Two did not show the options. ~/.config/htop/htoprc was blank on the two that did not work. Changing settings on htop did not populate the file and settings were lost between sessions. File permissions were the same for all three. I copied the working htoprc to the other two and this solved the problem.
  4. If you use a SIP Voip client on your phone or computer, you can use the sip protocol and scripting to monitor your Armbian board. I'm using Ubuntu Xenial, but other versions should work as well. I have the Linphone client on my phone and I use the free Linphone SIP service. Linphone.org hosts a free SIP service that allows users to make audio or video calls using SIP addresses via the domain sip.linphone.org. You can also send text messages. SIP requires an internet data connection, and my phone is connected via WIFI most of the time except when I'm commuting, so I set up my monitoring chron jobs on the Armbian device to run at times when I'm connected. Set up a SIP account for yourself if you don't yet have one, and set up an account for your device. You can set up free accounts at https://www.linphone.org/freesip/home The example accounts used in this tutorial are: sip:armdevice@linphone.org and sip:youraccount@linphone.org Replace these with your own accounts. I suggest that you get your Voip service running and tested on your phone and another device or PC before you try and set up SIP scripting on your Armbian device. Install the Linphone console client on your Armbian device (Orange Pi Zero Plus in my case). sudo apt-get install linphone-nogtk When it has installed start the client linphonec You may get a bunch of warnings about unconfigured sound cards and etc. Unless you want to use voice or video, you can ignore these. ........ eventually you will get a linphonec prompt Warning: video is disabled in linphonec, use -V or -C or -D to enable. linphonec> If you type help, you will get a list of commands: linphonec> help Commands are: --------------------------- help Print commands help. call Call a SIP uri or number calls Show all the current calls with their id and status. chat Chat with a SIP uri terminate Terminate a call answer Answer a call pause pause a call resume resume a call transfer Transfer a call to a specified destination. conference Create and manage an audio conference. mute Mute microphone and suspend voice transmission. camera Send camera output for current call. unmute Unmute microphone and resume voice transmission. playbackga Adjust playback gain. duration Print duration in seconds of the last call. autoanswer Show/set auto-answer mode proxy Manage proxies soundcard Manage soundcards webcam Manage webcams ipv6 Use IPV6 nat Set nat address stun Set stun server address firewall Set firewall policy call-logs Calls history friend Manage friends play play a wav file record record to a wav file quit Exit linphonec --------------------------- Now you need to configure your SIP proxy. "help proxy" gives you the relevant commands linphonec> help proxy 'proxy list' : list all proxy setups. 'proxy add' : add a new proxy setup. 'proxy remove <index>' : remove proxy setup with number index. 'proxy use <index>' : use proxy with number index as default proxy. 'proxy unuse' : don't use a default proxy. 'proxy show <index>' : show configuration and status of the proxy numbered by index. 'proxy show default' : show configuration and status of the default proxy. We must use "proxy add". It will start an interactive session. Note the format of the proxy sip address enclosed with < and > linphonec> proxy add Adding new proxy setup. Hit ^D to abort. Enter proxy sip address: <sip:sip.linphone.org;transport=tls> Your identity for this proxy: sip:armdevice@sip.linphone.org Do you want to register on this proxy (yes/no): yes Specify register expiration time in seconds (default is 600): Expiration: 0 seconds Specify route if needed: No route specified. -------------------------------------------- sip address: <sip:sip.linphone.org;transport=tls> route: identity: sip:armdevice@sip.linphone.org register: yes expires: 0 registered: no -------------------------------------------- Accept the above proxy configuration (yes/no) ?: yes Proxy added. linphonec> Password for armdevice on "sip.linphone.org": Y0uR-pa$$word linphonec> Unregistration on <sip:sip.linphone.org;transport=tls> done. That's it you are now configured. (not sure what "unregistration" means, perhaps it's a typo and should say registration) Send yourself a test text and quit out of linphonec. Once again "help" is useful: linphonec> linphonec> help chat chat <sip-url> "message"' : send a chat message "message" to the specified destination. linphonec> chat <sip:youraccount@sip.linphone.org> "Testing sip messaging" linphonec> terminate No active calls linphonec> quit Terminating... How can you easily send messages from a script? Create a wrapper script using expect (uses tls not bash) If you don't have expect installed then sudo apt-get install expect Create a wrapper expect script called "send-sip.sh" #!/usr/bin/expect -f # send-sip.sh "this is a message" set message [lindex $argv 0]; spawn linphonec expect "<sip:sip.linphone.org;transport=tls> done." send "chat <sip:youraccount@sip.linphone.org> \"$message\"\r" expect "linphonec>" sleep 10 send "terminate\r" expect "linphonec>" send "quit\r" expect "Terminating..." exit Set execute permission on the file. I placed mine in /usr/local/bin chmod +x /path/to/file # e.g. chmod +x /usr/local/bin/send-sip.sh Now you can execute your wrapper from a script like this and it will send the message to your sip address. Change the path to the location of your wrapper script. /usr/local/bin/send-sip.sh "this is a sip message"
  5. How to install Puppeteer on node.js on Armbian. Tested on OrangePi Zero Plus running Ubuntu Xenial or Bionic. Should work on other boards and other builds. How to install the latest version of node.js. (at the time of writing was 12.7.0). Instructions for installing node.js on Debian and Ubuntu can be found at: https://github.com/nodesource/distributions/blob/master/README.md#deb The instructions at the time of writing were: # Using Ubuntu curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt-get install -y nodejs # Using Debian, as root curl -sL https://deb.nodesource.com/setup_12.x | bash - apt-get install -y nodejs Both of these methods work on Ubuntu. If you then try to install Puppeteer using "npm i puppeteer" you will discover that the version of Chrome that it installs locally is for the wrong CPU architecture. The solution to the problem is to install and use puppeteer-core instead of puppeteer. When using puppeteer core, you must define the path to Chrome or Chromium in the puppeteer script (see the test example below). First install a recent version of Chromium Browser. This will be used in headerless mode. apt-get install chromium-browser When the chromium-browser install is complete Create a folder for your Puppeteer project Let's assume that your folder is in /mnt/data/nodejs-scripts/screenshot (mine was on a mounted ntfs drive). cd /mnt/data/nodejs-scripts/screenshot npm init -y npm i puppeteer-core --save Now create a node.js test script Lets say that you call it screenshot.js Using your favorite editor insert the following lines into the file. const puppeteer = require('puppeteer-core'); (async ()=>{ const browser = await puppeteer.launch({ executablePath: '/usr/bin/chromium-browser', args: ['--no-sandbox'], headless: true }); const page = await browser.newPage(); await page.goto('https://duckduckgo.com/'); await page.screenshot({path: 'screenshot.png'}); await browser.close(); })(); Make the script executable. chmod +x screenshot.js You can now run the script cd /mnt/data/nodejs-scripts/screenshot nodejs screenshot.js If it has worked, you will find a screenshot of the DuckDuckGo page in your project folder.
  6. Orange Pi Zero NTP Stratum 1 PPS GPS Server with Armbian OS. Link to the Tutorial - http://schwartzel.eu3.org/ntp-stratum1.html This tutorial uses a 3.3V capable GPS module with PPS output - TOPGNSS GN-701 (u-blox 7) but other similar modules should work. This tutorial is for the Orange Pi Zero, but will probably work for other boards. I couldn't easily do a comprehensive hardware and software tutorial on this forum, so I've published it on my web server and linked from here and attached a PDF. Link to the Tutorial - http://schwartzel.eu3.org/ntp-stratum1.html Tutorial PDF ntp-stratum1.pdf If you spot any typo's or errors please let me know.
  7. Elektrický


  8. I posted in "Armbian build framework" when it should be in "Allwinner A64, H5 & H6". (It might be useful for other newbs like me if in the right place) https://forum.armbian.com/topic/8192-where-how-can-i-edit-boot-environment-on-the-spi-nor-flash-on-zero-plus/?do=findComment&amp;comment=61853
  9. Thanks martinayotte - it is working now. I'm describing this for other newbs who might struggle to find these things. Your referenced patch has pointed me to "arch/arm/mach-sunxi/usb_phy.c" which I found in my Vagrant build environment at "/home/vagrant/armbian/cache/sources/u-boot/<version>/" The line "static int initial_usb_scan_delay = CONFIG_INITIAL_USB_SCAN_DELAY;" exists so it looks like the referenced patch is now a part of the build. I found the u-boot configs under "/home/vagrant/armbian/cache/sources/u-boot/<version>/configs" and the one for my board is named "orangepizero_plus_defconfig" cd /home/vagrant/armbian sudo nano config-default.conf modify line CREATE_PATCHES="no" to CREATE_PATCHES="yes" ^X y enter to save sudo ./compile.sh Select your board then enter at the prompts until you reach: [ warn ] Make your changes in this directory: [ /home/vagrant/armbian/cache/sources/u-boot/] [ warn ] Press <Enter> after you are done [ waiting ] In a new session - (I used putty, I couldn't do it from the windows command prompt vagrant ssh ) cd /home/vagrant/armbian/cache/sources/u-boot/<version>/configs sudo nano orangepizero_plus_defconfig add a line CONFIG_INITIAL_USB_SCAN_DELAY=3000 ^X y enter to save Back to the original session press enter and answer all prompts until compile is complete. diff --git a/configs/orangepizero_plus_defconfig b/configs/orangepizero_plus_defconfig index 4298f1e..ef14bcb 100644 --- a/configs/orangepizero_plus_defconfig +++ b/configs/orangepizero_plus_defconfig @@ -20,3 +20,4 @@ CONFIG_SUN8I_EMAC=y CONFIG_USB_EHCI_HCD=y CONFIG_MMC_SUNXI_SLOT_EXTRA=2 CONFIG_SD_BOOT=y +CONFIG_INITIAL_USB_SCAN_DELAY=3000 The patch will be in \vagrant\output\patch\u-boot-sunxi64-next.patch Don't be tempted to edit this file in windows. It will be corrupted by the line feeds.
  10. I'm a newb, so please make allowances if I am a little dumb. I have SPI NOR boot working on an Orange Pi Zero Plus (H5). Latest next kernel. (I've tried the download, and compiled my own). There is a problem when I power on. It fails to detect the USB drive. If I reset the CPU it finds the drive. If I reboot it finds the drive. resetting USB... USB0: USB EHCI 1.00 USB1: USB OHCI 1.0 scanning bus 0 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found I want to try some things in the boot environment settings, but I haven't figured out where to do this. Can anyone point me in the right direction to modify the environment for this board? I have a Vagrant build environment set up, so I can compile, but so far I haven't been able to find where these settings are configured
  11. Is there a way to modify the uboot scripts? I want to try doing a usb reset or delay before the usb start. When the device fails to boot after a power up at the uboot prompt, I type: usb reset => usb reset resetting USB... USB0: USB EHCI 1.00 USB1: USB OHCI 1.0 scanning bus 0 for devices... 2 USB Device(s) found scanning usb for storage devices... 1 Storage Device(s) found then I type => usb start => run usb_boot => usb start => run usb_boot Device 0: Vendor: Generic Rev: 1.14 Prod: External Type: Hard Disk Capacity: 70911.1 MB = 69.2 GB (145226111 x 512) ... is now current device Scanning usb 0:1... Found U-Boot script /boot/boot.scr The boot is then successful. I'm very new to linux, and I have not been successful in my search for how to modify the uboot scripts. I have set up a build environment with Vagrant in case it is needed, but I don't know where to find / modify these scripts.
  12. I found some clues in this forum, and realized that it was probably a buggy version. That's why I tried the latest version and it worked. https://forum.armbian.com/topic/5218-spiusb-boot-orange-pi-pc2/?tab=comments#comment-39741
  13. I tried with the uboot from Armbian_5.59_Orangepizeroplus_Ubuntu_bionic_next_4.14.65 (the latest that I could find). It worked better and booted into uboot but I now have one problem: It didn't find my USB drive until I reset the CPU starting USB... USB0: USB EHCI 1.00 USB1: USB OHCI 1.0 scanning bus 0 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found Autoboot in 1 seconds, press <Space> to stop Card did not respond to voltage select! MMC: no card present Device 0: device type unknown ... is now current device ** Bad device usb 0 ** ** Bad device usb 0 ** I did a CPU reset and it booted OK. After a reboot it boots OK. After a power up it fails until a CPU reset is done. Any idea how I can solve this?
  14. I tried flashing the concatenated sunxi-spl.bin u-boot.itb to the uboot partition mtd1 (from instructions elsewhere on this forum) https://forum.armbian.com/topic/5218-spiusb-boot-orange-pi-pc2/?tab=comments#comment-42665 The flash worked. apt-get install mtd-utils cat /usr/lib/linux-u-boot-next-orangepizeroplus_5.38_arm64/sunxi-spl.bin /usr/lib/linux-u-boot-next-orangepizeroplus_5.38_arm64/u-boot.itb > /usr/lib/linux-u-boot-next-orangepizeroplus_5.38_arm64/u-boot-sunxi-with-spl.bin flashcp /usr/lib/linux-u-boot-next-orangepizeroplus_5.38_arm64/u-boot-sunxi-with-spl.bin /dev/mtd1 This gave me errors on reboot without SD: Resetting CPU ... resetting ... "Synchronous Abort" handler, esr 0x5e000000 ELR: 12098 LR: 4fdfec70 x 0: 0000000084000009 x 1: 000000004fdfec90 x 2: 0000000000016934 x 3: 000000004fdfecb0 x 4: 000000000001417c x 5: 000000004fdfeeb0 etc....