Yun 17.11 Reboot prerelease

GPIO /PWM FROM NODEJS :

As I said, i'm a nodejs dev and with the earlier versions (LININO), I could access gpio & pwm pins directly from my node js scripts :
The best way to do that for me was using lininoio method http://wiki.linino.org/doku.php?id=wiki:upgradetolininoio :
the command 'lininoio start' upload a 'bathos-xxx.hex' sketch. and change 'Arduino console to 'spicons' and other things that I didn't succès to redo, but with lininoio I could acces gpio pin directly with linux command as explained here http://wiki.linino.org/doku.php?id=wiki:lininoio_sysfs
Is there a way to access the arduino pins (gpio, pwm...) in the same way with the new Reboot 17-11 ?
It would be a good thing for me if I could :wink: .

Because I was blocked, I tried to use cylon Arduino YUN with Cylon.js and Cylon.js Fun With The Arduino Yun

with this simple script :

var Cylon = require('cylon');

Cylon.robot({
connections: {
arduino: { adaptor: 'firmata', port: '/dev/ttyATH0' }
},

devices: {
led: { driver: 'led', pin: 13 }
},

work: function(my) {
every((1).second(), function(){
my.led.toggle();
});
}
}).start();

so I have installed node-cylon-firmata :
...
Downloading http://downloads.arduino.cc/openwrtyun/17.11/packages/packages/mips_24kc/packages/node-cylon_0.22.0-7_mips_24kc.ipk
[...]
Configuring node-cylon.
Configuring node-arduino-firmata.
Configuring node-cylon-i2c.
Configuring node-cylon-gpio.
Configuring node-cylon-firmata.
root@Arduino:~# node cylontest.js
Cannot find the 'cylon-firmata' module.
This problem might be fixed by installing it with 'npm install cylon-firmata' and trying again.
Terminated

but cylon-firmata is not found : I thought that node-cylon-firmata was the remplacement of cylon-firmata but ???


So I installed 'cylon-firmata' 'firmata' as describe here https://cylonjs.com/documentation/platforms/yun/
installing on my windows (uninstall node 9 & install node 6), then transfering with winscp : 

mkdir cyloninstall
cd cyloninstall
npm init
npm install firmata

remove cylonfirmata/serialport , then transfert to /usr/lib/node

and then .... got that : 

root@Arduino:~# opkg install node-cylon
Installing node-cylon (0.22.0-7) to root...
Downloading http://downloads.arduino.cc/openwrtyun/17 .11/packages/packages/mips_24kc/packages/node-cylon_0 .22.0-7_mips_24kc.ipk
Installing node (v6.11.2-3) to root...
Downloading http://downloads.arduino.cc/openwrtyun/17 .11/packages/packages/mips_24kc/packages/node_v6.11.2 -3_mips_24kc.ipk
Installing node-npm (v6.11.2-3) to root...
Downloading http://downloads.arduino.cc/openwrtyun/17 .11/packages/packages/mips_24kc/packages/node-npm_v6. 11.2-3_mips_24kc.ipk
Configuring node.
Configuring node-npm.
Configuring node-cylon.
root@Arduino:~# opkg install node-cylon-firmata
Installing node-cylon-firmata (0.22.0-7) to root...
[...]
Configuring node-serialport.
Configuring node-arduino-firmata.
Configuring node-cylon-i2c.
Configuring node-cylon-gpio.
Configuring node-cylon-firmata.
root@Arduino:~# touch cylontest.js
root@Arduino:~# node cylontest.js
(node) v8::ObjectTemplate::Set() with non-primitive v alues is deprecated
(node) and will stop working in the next major releas e.

==== JS stack trace ================================= ========

Security context: 0x5be2a925 #0#
1: .node [module.js:597] [pc=0x5e763744] (this=0x 5bef84dd <an Object with map 0x2341fde1>#1#,module=0x 57edb2b5 <a Module with map 0x234206fd>#2#,filename=0 x57eda53d <String[54]: /usr/lib/node/serialport/build /Release/serialport.node>)
2: load [module.js:487] [pc=0x236e8bb8] (this=0x5 7edb2b5 <a Module with map 0x234206fd>#2#,filename=0x 57eda53d <String[54]: /usr/lib/node/serialport/build/ Release/serialport.node>)
3: tryModuleLoad(aka tryModuleLoad) [module.js:44 6] [pc=0x236e8480] (this=0x5be08121 ,modul e=0x57edb2b5 <a Module with map 0x234206fd>#2#,filena me=0x57eda53d <String[54]: /usr/lib/node/serialport/b uild/Release/serialport.node>)
[...]
71: /* anonymous /(aka / anonymous /) [module.j s:604] [pc=0x236d570c] (this=0x5be08121 )
72: run(aka run) [bootstrap_node.js:389] [pc=0x236 d5514] (this=0x5be08121 ,entryFunction=0x5 bed0565 <JS Function Module.runMain (SharedFunctionIn fo 0x5bebadcd)>#41#)
73: startup(aka startup) [bootstrap_node.js:149] [ pc=0x236919b0] (this=0x5be08121 )
74: /
anonymous /(aka / anonymous */) [bootstra p_node.js:504] [pc=0x2368e6e4] (this=0x5be08109 ,process=0x5bef8ab9 <a process with map 0x23413705># 42#)

I, [2017-12-15T00:16:55.648Z] INFO -- : [Robot 1] - Starting connections.
/usr/lib/node/firmata/lib/firmata.js:554
this.transport = new com.SerialPort(port, setting s.serialport);
^

TypeError: com.SerialPort is not a constructor
at new Board (/usr/lib/node/firmata/lib/firmata.j s:554:22)
at Adaptor.connect (/usr/lib/node/cylon-firmata/l ib/firmata.js:42:16)
at Robot. (/usr/lib/node/cylon/lib/rob ot.js:299:27)
at /usr/lib/node/cylon/lib/utils/helpers.js:237:3 6
at Array.forEach (native)
at Object.parallel (/usr/lib/node/cylon/lib/utils /helpers.js:237:13)
at Robot.startConnections (/usr/lib/node/cylon/li b/robot.js:303:12)
at next (/usr/lib/node/cylon/lib/utils/helpers.js :266:22)
at Object.series (/usr/lib/node/cylon/lib/utils/h elpers.js:270:3)
at Robot.start (/usr/lib/node/cylon/lib/robot.js: 235:5)
at Object. (/root/cylontest.js:17:4)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:1 0)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
root@Arduino:~#


trying to put the 'serialport' from the 'firmata' folder & got this : 

root@Arduino:~# node cylontest.js
It looks like serialport didn't compile properly. This is a common problem and its fix is well documented here https://github.com/voodootikigod/node-serialport#to-install
The result of requiring the package is: undefined

/usr/lib/node/cylon/lib/registry.js:39
throw e;
^
Missing serialport dependency
root@Arduino:~#

no more idea I'm blocked.

It was so simple with the lininoio method !!!
HOW COULD I 'SIMPLY' ACCESS GPIO/ PWM from the nodejs programs I've developped ???????????

DOn't please tell me it's not possible...

Woah, such a lot on information :slight_smile: Thank you!
I'm trying to answer them "inline".

Yun updater tool: the serial monitor and anything which holds the lock on the serial port must be closed before launching the tool. About the uboot prompt, it should recognize "ard", "lin" and "any button" stop words so it's a bit strange that it didn't; I'll investigate

ArduinoOS as a package: can be done, it's not a top priority though

YunDiskSpaceExpander on this link is already adapted to the new image, you probably used the old one.
About swap, it's a good idea, I'll add it to that script

LininoIO: again, it's not a top priority, but if it gets some traction I'll package it and make it available via opkg

Node-cyclon-serialport: thanks for testing, I'll check if the problem is on our compilation recipe or somewhere else

Thxs for your job.

With YunDiskExpander that you mention, I got this error messaege :

This sketch will format your micro SD card and use it as additional disk space for your Arduino Yun.
Please ensure you have ONLY your micro SD card plugged in: no pen drives, hard drives or whatever.
Do you wish to proceed (yes/no)? yes

Starting Bridge...

Ready to install utility software. Please ensure your Arduino Yun is connected to internet.
Ready to proceed (yes/no)? yes
Updating software list...
Software list updated. Installing software (this will take a while)...
e2fsprogs dosfstools fdisk rsync kmod-fs-ext4 installed

Proceed with partitioning micro SD card (yes/no)? yes
Enter the size of the data partition in MB: 3000
Partitioning (this will take a while)...

err. formatting to EXT4

with dmesg like that :


[ 436.812368] wlan0: associated
[ 436.813954] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 437.111673] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0-1: link becomes ready
[ 511.003990] sd 0:0:0:0: [sda] 15196160 512-byte logical blocks: (7.78 GB/7.25 GiB)
[ 511.015670] sda: sda1 sda2
[ 665.125842] kmodloader: loading kernel modules from /etc/modules.d/*
[ 665.357549] kmodloader: done loading kernel modules from /etc/modules.d/*
[ 665.863450] kmodloader: loading kernel modules from /etc/modules.d/*
[ 665.873601] kmodloader: done loading kernel modules from /etc/modules.d/*
[ 716.019422] sda: sda1
[ 717.161115] EXT4-fs (sda1): mounting ext3 file system using the ext4 subsystem
[ 718.838929] EXT4-fs (sda1): recovery complete
[ 718.845881] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts:
root@Arduino:~#

Perharps could I do what I want without lininoio, with Serial1 communicating to /dev/ttyATH0 as explain in this github :

I

I'll explore a new way,
I've just discovered I could use ttyATH0

with this sketch :

void setup() {
// Open serial communications and wait for port to open:
Serial.begin(57600);
Serial1.begin(250000);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
while (!Serial1) {
; // wait for serial port to connect. Needed for native USB port only
}

Serial.println("Goodnight moon!");
Serial1.println("Goodnight moon!");
}

void loop() { // run over and over
if (Serial1.available()) {
Serial.write(Serial1.read());
}
if (Serial.available()) {
Serial1.write(Serial.read());
}
}

with 2 linux terminal, in the first, i use

root@Arduino:~# cat /dev/ttyATH0

& in the other, i write with :

root@Arduino:~# echo ok > /dev/ttyATH0
root@Arduino:~# echo test > /dev/ttyATH0

Is there a bidirectional sketch that map directly Arduino pins & fonction (pinmode, analogRead, digitalWrite...), so I could write something like a JSON :

echo {"D13":1,"PWM9":45} > /dev/ttyATH0 ???

I will explore with #include <ArduinoJson.h>
?

Hi,

I have an Arduino YUN shield and a 8device NUY shield. will this work on them? or just the original YUN. I also have 2 Arduino TIAN, will these still be supported in the future?

Thanks,
Luc

Really excited about a big update! Is there a rough timeline for when this will come out of beta (weeks or months)?

@ltheoret Yun shield (NUY if branded by 8devices) will surely be supported at some point. Probably you'll need to update Caraboot manually to accept the new partition layout but it will be quite simple. The same applies to Yun mIni and Industrial 101. Tian, instead, is really a product on its own and won't be available with this port.

@TrashCompactor we are still fixing some little bugs here and there, but I think we'll go really live near the end of January.

Hi facchinm,

Thank you for the update.

Luc

Aaaand after all this, now the Yun's been retired?!

Finally a chance to try it out ... so far the auto updater is not working. Needs sudo for the tftp daemon, assumes there isn't one already running (closed my existing) and then an IP address conflict (switched off local machine causing the conflict)

I'm still getting a timeout at flashing the boot loader: ...

Flashing Bootloader
tftp 0x80060000 u-boot-arduino-lede.bin
eth0 link down
FAIL
eth1 link down
FAIL
Using eth0 device
TFTP from server 192.168.99.200; our IP address is 192.168.99.201
Filename 'u-boot-arduino-lede.bin'.
Load address: 0x80060000
Loading: T T T T T T
expect: timer expired after 30 seconds
Could not get your IP address, check your network connection

Update: seemed like the ip address setup was a bit finicky about being on an existing network, got it working after isolating on a cross over cable.

Nice to see an update on the Yun, off to explore ! Thanks :slight_smile:

@facchinm ... what is the status on this ? I was playing along nicely but then needed some new modules, looks like kernel updates etc. needed but not available ?

Hi, the links arent' working. Is this project dead?

Doesn't seem dead but this thread does.

try these: Releases · arduino/yun-go-updater · GitHub

niallp:
Finally a chance to try it out ... so far the auto updater is not working. Needs sudo for the tftp daemon, assumes there isn't one already running (closed my existing) and then an IP address conflict (switched off local machine causing the conflict)

I'm still getting a timeout at flashing the boot loader: ...

Flashing Bootloader
tftp 0x80060000 u-boot-arduino-lede.bin
eth0 link down
FAIL
eth1 link down
FAIL
Using eth0 device
TFTP from server 192.168.99.200; our IP address is 192.168.99.201
Filename 'u-boot-arduino-lede.bin'.
Load address: 0x80060000
Loading: T T T T T T
expect: timer expired after 30 seconds
Could not get your IP address, check your network connection

Update: seemed like the ip address setup was a bit finicky about being on an existing network, got it working after isolating on a cross over cable.

Nice to see an update on the Yun, off to explore ! Thanks :slight_smile:

niallp:
Finally a chance to try it out ... so far the auto updater is not working. Needs sudo for the tftp daemon, assumes there isn't one already running (closed my existing) and then an IP address conflict (switched off local machine causing the conflict)

I'm still getting a timeout at flashing the boot loader: ...

Flashing Bootloader
tftp 0x80060000 u-boot-arduino-lede.bin
eth0 link down
FAIL
eth1 link down
FAIL
Using eth0 device
TFTP from server 192.168.99.200; our IP address is 192.168.99.201
Filename 'u-boot-arduino-lede.bin'.
Load address: 0x80060000
Loading: T T T T T T
expect: timer expired after 30 seconds
Could not get your IP address, check your network connection

Update: seemed like the ip address setup was a bit finicky about being on an existing network, got it working after isolating on a cross over cable.

Nice to see an update on the Yun, off to explore ! Thanks :slight_smile:

Hello,
TFTP server is your computer. run TFTP util on your computer.
Then on u-boot status, put the cmd 'setenv serverip your ip'
Next, put 'setenv ipaddr board's ip ' . You can use any thing as board ip if
it is in your network. Then re try.

Have a good luck.

Hello, thanks to new update.

I tried it but got a fail. So, I set up it manually resulting in a success.

Anyone who try it manually should be careful at some points.

You should use a new disk-expander util because old one yields a insufficient memory alarm.
(use the new version in the go-update package).

Next, you should update your u-boot at first due to a large package.

I am really happy due to this new update. I have some problems in using the python in the old version
(especially pip was not working due to certification problem). Now, it works fine.
Thanks.

Hi, I have tried everything and it's not working. I tried on WiFi anb on Wired network too. Actually the Mac is on WiFi and the Yún is connected via ethernet cable. Why does it always stop with: Could not get your IP address, check your network connection

Enter server IP address: 192.168.1.176
Enter board IP address: 192.168.1.198
Found port: /dev/cu.usbmodem1421
USB ID     2341:8041
USB serial 
Using it
Restarting in bootloader mode
Get port list before reset
Wait for the port to disappear
Wait for the port to reappear
Found upload port:  /dev/cu.usbmodem1421
Flashing with command:/Users/alejandroimass/Downloads/Yun GO Updater 17.11/avr/bin/avrdude -C/Users/alejandroimass/Downloads/Yun GO Updater 17.11/avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -P/dev/cu.usbmodem1421 -b57600 -D -Uflash:w:/Users/alejandroimass/Downloads/Yun GO Updater 17.11/avr/YunSerialTerminal.ino.hex:i
Wait for the port to disappear
Wait for the port to reappear
Found upload port:  /dev/cu.usbmodem1421
Rebooting the board
Using stop command: ard
Got shell: ar7240
fwShell: ar7240
Flashing Bootloader
182492 bytes sent
Setting up IP addresses
Could not get your IP address, check your network connection

@AgroMeInc

If it already picked up an IP via DHCP it will be listed in your router DHCP list.

Worth checking that out as mine went right into DHCP after the update and the IP's were no longer viable Mine jumped into the system as 192.168.0.12 (which is in my subnet)

Does this stuff work for the Arduino Yun Rev 2? It doesn't say so specifically and it was created well before the Rev 2 was released.

Please clarify.

This is cool, I tried to flash openwrt latest from old yun 1.5 whatever and it would not work, not sure if it was this thread I saw or found it elsewhere, but tried this and indeed it did update OK, he mentions a new bootstrap that expands the space for the root partition to allow later openwrt images to be loaded, If anyone can further clue me in on where that is from I would be interested to know. I would like to know from sub-basement up what is going on

Anyway, the process this did then allows latest openwrt to be loaded, why do that? latest versions of software/packages of course!

So, with latest openwrt do not bother with any of the usual yun bloat not even yunbridge, ttyS0 is not there anymore, all any programmer needs is to find out how to shut down the console on ttyATH0 (documented on openwrt wiki or forum) and then use stty or setserial to set baud rate a bit higher and do comms to arduino over that serial port, NICE.

I was having problems programming arduino side of yun without a network connection with this update, but with latest openwrt the arduino is not tied to the atheros anyway except through serial port and programming works fine in isolation.

btw, the yunserialconsole sketch does work after update to openwrt 18.06.04 if you set the baud rate to 9600 in the sketch not the 250,000 it defaults to.

A great board!

That said, this 17.11 reboot update has got ssl to luci and all the stuff someone who has played with all the arduino additions might want, though obviously not absolutely all things as someone on this thread was annoyed at. I tested bridge and remote gpio setting which is ok.

STM anyone reasonably skilled coming at this fresh may be better with going next step to latest openwrt, dropping bridge and just writing a python script on atheros side to communicate with their sketch over ttyATH0.

Essentially for playing with the several Arduino layers on top, this 17.11 is cool, but for doing something dedicated with the yun, step up to openwrt latest.