Elektrický

Members
  • Content Count

    24
  • Joined

  • Last visited

About Elektrický

  • Rank
    Member

Profile Information

  • Location
    Auckland New Zealand

Recent Profile Visitors

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

  1. 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"
  2. 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.
  3. 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.
  4. Elektrický

    Elektrický

  5. 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
  6. 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.
  7. 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
  8. 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.
  9. 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
  10. 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?
  11. 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....
  12. Success! Many thanks for your help. I logged in as root and followed your instructions slightly modified: Modified source with only two partitions (only the first is used). apt-get install flex apt-get install bison git clone https://github.com/pantoniou/dtc.git cd dtc git checkout dt-overlays5 make PREFIX=/usr make install /root/dtc/dtc -@ -I dts -O dtb -o /boot/overlay-user/my-spinor.dtbo /boot/overlay-user/my-spinor.dts reboot cat /proc/mtd This produced: dev: size erasesize name mtd0: 00100000 00001000 "env" mtd1: 00100000 00001000 "uboot" opi-zero-plus-spi-nor-source.txt
  13. I was able to install the dtc compiler with symbol support after installing flex and bison. The "-@" parameter was not recognized, and gave Error: unknown option. It is not listed in the help output. As this is for symbol support, I am pretty sure that this is caused by it using the wrong dtc compiler as there is one already installed without symbol support. I will try and figure out how to fix this.