September 30, 2023, 05:45:22 AM
Welcome, Guest. Please login or register
News: Stay up to date with everything that's happening at http://twitter.digitalsignage.com

MediaSignage support forum



Author Topic: Some problems with ioT and Arduino  (Read 13969 times)

2tor

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Some problems with ioT and Arduino
« on: December 23, 2014, 02:31:44 PM »
Dear all,

I have some problems with ioT and Arduino. I´m just following all the instructions in the web: (see github dot com slash born2net slash mediaArduino)
but I´m stuck in one point and I can not continue.

Let me explain what I have found: comments in bold
 
-          I have upgraded de firmware of arduino yun to version 1.52.
-          I have configured Arduino wifi to be connected to my LAN network so I can connect to it via wifi without any problem.
-          I have also done the following steps referred in the above mentioned web page:
-          Burnt the Linux OS onto the Micro SD card. Download it from: ( see: digitalsignage dot com slash arduino slash SD_Image slash ArduinoOpenWRT.imgc)
-          To burn the binary image we will use a HDD Sector copy application for Windows. Downloaded from: (see the  original page here is not allowed to put external links)
-          Install the application in Windows HDDRawCopy1.10Setup.exe
-          Next you will need to connect the Micro SD to the PC, it should come up as a drive letter in Windows, like F:\ or something of that sort.
-          Next, launch HDDRawCopy, select source from file (double click) and select the downloaded file of: PerfectArduino.imgc   --> I do not recognize this name… see above the downloaded image was ArduinoOpenWRT.imgc What file shouls I record in the SD ArduinoOpenWRT.imgc or PerfectArduino.imgc ??
-          Now click 'next' to select the target device, which will be the drive letter of the Micro SD (be sure tp select the correct drive letter or you may lose data by formatting the wrong device).
-          Next, pick the Micro SD and click start to begin the burning process of the Linux OS image onto the micro SD card, this will take a little while.
-           Once it's done you can remove the micro SD from your PC and plug it into the Arduino --> Inside the sd card there is only one folder called arduino and inside it, another one called www and that´s all inside the sd card. Is this correct? What I should see inside the sd card?
-          Now that the Arduino is on your WIFI or Ethernet network, you will need to know it's IP address. The best way to figure this out is to install the Arduino IDE, from: (see: arduino dot cc slash en slash Main slash Software)
-          Next, connect the Arduino to your PC or Mac via USB cable.
-          Inside Arduino IDE, select the board type from: Tools > Board > Arduino Yun
-          Next, select Tools > Port to see it's new IP address that the Arduino received from your local network.
-          Next you need to ssh (login) onto the Linux side of the Arduino.
-          Once you confirm your Windows or Mac has the ssh command, execute ssh at YOUR_IP_ADDRESS, as in:
-          ssh root att 192.168.1.94
-          Default password is: arduino
-          Select 'yes' when ssh prompts you to remember the host.
-          Next, while logged into the Arduino Linux, execute the command:
-          cp /.extroot.md5sum /tmp/overlay-disabled/etc/extroot.md5sum -->I can not run this command because the directory /tmp/overlay-disabled an so on does not exist. I can do it manually, but I guess that once reboot as it is a tmp folder it will disappear  Any suggestion here??.
-          this will create a clean md5 hash so OpenWRT accepts the Micro SD as a valid device to mount. Don't reboot the Arduino just yet, as we need to install the Firmata driver onto the MCU of the Arduino so we can communicate with it from the node.js using the Firmata.js package.
-          Download from this git repository the file of:
-          firmata slash firmata.ino
-          and put it in a directory on your Mac or PC of: firmata/firmata.ino
-          you will also need to download 3 more files from this repository:
-          firmataSketch library\Boards.h
-          firmataSketch library\Firmata.cpp
-          firmataSketch library\Firmata.h
-          You will need to override the 3 default files that ship with Arduino as this library firmata files also add support for String argument passing to allow us to run custom C functions from Node.js. In Windows override the files at:
-          C:\Program Files (x86)\Arduino\libraries\Firmata\src
-          In Mac, I am not sure where are they located, it should be within the installation directory of the Arduino IDE installed App.
-          Next, we will burn in the firmata.ino C sketch into Arduino
-          In the Arduino IDE App select to open the sketch of:
-          firmata/firmata.ino
-          In the Arduino IDE App select Tools > Port > and select the Com port or IP address of the Arduino
-          Next, click update and upload to burn in the Firmata driver onto the MCU.
-          Once it's done, reboot the Arduino
-         
________________________________________
-          Is it all working?
-          At this point you should be able to ssh back onto the Arduino, execute:
-          cd /root
-          ls -al
-          you should see a bunch of files, if you do, you are in good shape. --> I do not see any file mounted in /root directory.  I´m stuck here and I do not how to have progress on this.
- If you don't you must have missed a step as OpenWRT did not mount the Micro SD as the main Linux drive. Now lets test that Node.js can communicate with the Micro controller. Type:
-          /root/dev/testFirmata.js
-          You should see the text below and the red LED on pin 13 should blink a few times. If you did, GOOD JOB, the hard part is behind you.

What suggestions do you see, where would it be the problem?
 
Regards.

admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 5181
  • Karma: +36/-8
Re: Some problems with ioT and Arduino
« Reply #1 on: December 23, 2014, 04:52:04 PM »
well the key to all the post is that you need to download and burn: PerfectArduino.imgc
if that will work ok for you, the rest should all just work...
so did the image download and burn ok?

regards

2tor

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Some problems with ioT and Arduino
« Reply #2 on: December 29, 2014, 03:04:21 AM »
Hi all,

I have been reviewing once more all the steps but I´m still blocked there.

Let me explain...

1st: There is a inconsistency in the explanation that should be corrected: See the following text just copied from the webpage and my comments.

When the device has been updated with the latest firmware, configure it to join your wifi network (click the configure button on the web interface) and once again reboot it. --> OK

Next, we will burn the Linux OS onto the Micro SD card. Download it from: (The link to ArduinoOpenWRT.imgc) --> Inconsistency A ?

To burn the binary image we will use a HDD Sector copy application for Windows. Download it from: (Link to the software)

Install the application in Windows HDDRawCopy1.10Setup.exe --> OK

Next you will need to connect the Micro SD to the PC, it should come up as a drive letter in Windows, like F:\ or something of that sort. --> OK

Next, launch HDDRawCopy, select source from file (double click) and select the downloaded file of: (The link to ... PerfectArduino.imgc) -->Inconsistency B ?? ... What is the image to burn finally?? following your suggestions should be this one, but I have just burnt the image and the same results. The image generates into the SD card a folder named arduino and inside a new folder named www but NO FILES INSIDE !!!

Now click 'next' to select the target device, which will be the drive letter of the Micro SD (be sure tp select the correct drive letter or you may lose data by formatting the wrong device). --> Done OK

Next, pick the Micro SD and click start to begin the burning process of the Linux OS image onto the micro SD card, this will take a little while. --> Done OK

Once it's done you can remove the micro SD from your PC and plug it into the Arduino. --> Done OK

2nd. Same results even burning PerfectArduino img
As explained above, following your suggestions, I have burnt the PerfectArduino image but I get the same results. Trying to dig a little bit more about the content inside the Sd card, I only see a folder named arduino and inside a new folder named www but NO FILES INSIDE !!!  If I explore the Sd card in a PC I see the same estructure but no files at all.  How could I ensure where is the problem?

3rd. Still find the problem of executing the following command
I can not execute the command :  cp /.extroot.md5sum /tmp/overlay-disabled/etc/extroot.md5sum

Linux answer:
root@Arduino:~# cp /.extroot.md5sum /tmp/overlay-disabled/etc/extroot.md5sum
cp: can't create '/tmp/overlay-disabled/etc/extroot.md5sum': No such file or directory


I detect that the msg comes because there is no folder /tmp/tmp-overlay in the linux estructure

Any help will be appreciated.
 
Regards.

admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 5181
  • Karma: +36/-8
Re: Some problems with ioT and Arduino
« Reply #3 on: December 29, 2014, 10:19:37 AM »
ok let me explain.

first, I did remove the wrong link in the doc, so only 1 link exists now to the correct PerfectArduino image.
second, it's ok that you are seeing only one folder since once you burn the image, it creates a new partition so you will not be able to see any folders on the SD card when its inside a Windows PC, so no problem  with that.

Now, the real issue is why are you having a problem with:
cp /.extroot.md5sum /tmp/overlay-disabled/etc/extroot.md5sum

are you running this command AFTER you have SSHed into the Arduino that's loaded with the new SD card?

I just followed the steps and everything worked fine for me.

basically, if you arduino has been upgraded to the correct firmware as in the doc, and the burning of the SD card was successfully completed, at that point when you insert the SD Card and reboot the Arduino you will not see any files, until you run the command:

cp /.extroot.md5sum /tmp/overlay-disabled/etc/extroot.md5sum

inside the Arduino, this clear the drive cache so after the next reboot, it will mount the SD card as a new partition...

let me know,

Sean.

2tor

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Some problems with ioT and Arduino
« Reply #4 on: December 30, 2014, 03:37:14 AM »
Hi Sean,

thank you for your time in helping me.

are you running this command AFTER you have SSHed into the Arduino that's loaded with the new SD card? --> Yes I have but and no sucess. What I see is that inside /tmp there is no /overlay-disabled folder and obviously nor the below folders. This is where I think the
error msg comes.


In order to be sure, I have just upgraded arduino OpenWRT to version 1.52 one more time  using a second SD card with the image on it.
just after the upgrade I connect via ssh with no SD card inserted:

login as: root

BusyBox v1.19.4 (2014-10-17 22:40:10 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------


root@Arduino:~# ls
root@Arduino:~# cd ..
root@Arduino:/# ls
bin      etc      mnt      proc     root     sys      usr      w w w
dev      lib      overlay  rom      sbin     tmp      var
root@Arduino:/# cd tmp
root@Arduino:/tmp# ls
TZ                   lock                 resolv.conf
dhcp.leases          log                  resolv.conf.auto
etc                  luci-indexcache      run
fstab                luci-sessions        state
hosts                overlay              sysinfo
lib                  pgp_message.txt      triggerhappy.socket
root@Arduino:/tmp#

As you can see inside /tmp there is no "overlay-disabled" folder.

Now I inserted the SD card with the image "PerfectArduino.imgc", and see:

root@Arduino:/tmp#
root@Arduino:/tmp# cd ..
root@Arduino:/# cd
root@Arduino:~# cp /.extroot.md5sum /tmp/overlay-disabled/etc/extroot.md5sum
cp: can't create '/tmp/overlay-disabled/etc/extroot.md5sum': No such file or directory
root@Arduino:~# cd ..
root@Arduino:/# ls
bin      etc      mnt      proc     root     sys      usr      www
dev      lib      overlay  rom      sbin     tmp      var
root@Arduino:/# cd mnt
root@Arduino:/mnt# ls
sd    sda1  sda2
root@Arduino:/mnt# ls -l
lrwxrwxrwx    1 root     root             9 Dec 30 11:21 sd -> /mnt/sda1
drwxr-xr-x    3 root     root          4096 Jan  1  1970 sda1
drwxr-xr-x   13 root     root          4096 Nov  6 19:15 sda2
root@Arduino:/mnt# ls sd
arduino
root@Arduino:/mnt# cd arduino
-ash: cd: can't cd to arduino
root@Arduino:/mnt# cd sda1
root@Arduino:/mnt/sda1# cd arduino
root@Arduino:/mnt/sda1/arduino# ls
www
root@Arduino:/mnt/sda1/arduino# cd www
root@Arduino:/mnt/sda1/arduino/www# ls
root@Arduino:/mnt/sda1/arduino/www#


As you can see above the error is there "cp: can't create '/tmp/overlay-disabled/etc/extroot.md5sum': No such file or directory", and also you can see that the SD card has been mounted because I have access to it BUT there is NO FILES INSIDE.

Any other suggestion/help?
I continue in paralell with more test.

Regards.

admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 5181
  • Karma: +36/-8
Re: Some problems with ioT and Arduino
« Reply #5 on: December 30, 2014, 11:21:21 AM »
ok do this

Code: [Select]
mkdir  /tmp/overlay-disabled
mkdir /tmp/overlay-disabled/etc/
cp /.extroot.md5sum /tmp/overlay-disabled/etc/extroot.md5sum
reboot

2tor

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Some problems with ioT and Arduino
« Reply #6 on: December 30, 2014, 01:11:40 PM »
Done...

root@Arduino:~# mkdir  /tmp/overlay-disabled
root@Arduino:~# mkdir /tmp/overlay-disabled/etc/
root@Arduino:~# cp /.extroot.md5sum /tmp/overlay-disabled/etc/extroot.md5sum
root@Arduino:~# reboot
root@Arduino:~#


Ssh again after reboot:


login as: root

BusyBox v1.19.4 (2014-10-17 22:40:10 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------


root@Arduino:~# ls
root@Arduino:~# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime,size=30560k)
tmpfs on /dev type tmpfs (rw,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,noatime,mode=600)
/dev/mtdblock3 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlayfs (rw,relatime,lowerdir=/,upperdir=/overlay)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
/dev/sda1 on /mnt/sda1 type vfat (rw,sync,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sda2 on /mnt/sda2 type ext4 (rw,sync,relatime,user_xattr,barrier=1,data=ordered)
none on /proc/bus/usb type usbfs (rw,relatime)
root@Arduino:~# ls -la
drwxr-xr-x    2 root     root             3 Oct 18 10:41 .
drwxr-xr-x    1 root     root             0 Sep  8  2011 ..
root@Arduino:~# cd ..
root@Arduino:/# ls
bin      etc      mnt      proc     root     sys      usr      www
dev      lib      overlay  rom      sbin     tmp      var
root@Arduino:/# cd mnt
root@Arduino:/mnt# ls
sd    sda1  sda2
root@Arduino:/mnt# ls sda1
arduino
root@Arduino:/mnt# cd sda1
root@Arduino:/mnt/sda1# ls
arduino
root@Arduino:/mnt/sda1# cd arduino
root@Arduino:/mnt/sda1/arduino# ls
www
root@Arduino:/mnt/sda1/arduino# cd www
root@Arduino:/mnt/sda1/arduino/www# ls
root@Arduino:/mnt/sda1/arduino/www#

I don´t get anything.... after reboot the directory  "overlay-disabled" is gone and I do not see anything different:

root@Arduino:/tmp# ls
TZ                   lib                  resolv.conf.auto
dhcp.leases          lock                 run
etc                  log                  state
fstab                overlay              sysinfo
hosts                resolv.conf          triggerhappy.socket
root@Arduino:/tmp#


I know we are very close to solve it but honestly I do not know what is failing


Regards.

admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 5181
  • Karma: +36/-8
Re: Some problems with ioT and Arduino
« Reply #7 on: December 30, 2014, 06:16:32 PM »
try and burn the SD card one more time, make sure it ends successfully (no errors)
and repeat the steps, most importantly the cp overly stuff and do a hard reboot, it should mount the SD card...

2tor

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Some problems with ioT and Arduino
« Reply #8 on: January 02, 2015, 01:54:06 AM »
No success,

I still have the same problem and i have done it already several times.

In order to go step by step could you pls do:

- YUN upgraded to firmware 1.5.2.
- YUN with no sd card inside.

Pls login via ssh and do:

ls /tmp

and paste the results.  I´d like to know why you can execute with no problems the "cp" command.

In other hand pls tell me what is the content you see in the SD card under windows.

Regards.

admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 5181
  • Karma: +36/-8
Re: Some problems with ioT and Arduino
« Reply #9 on: January 02, 2015, 08:51:59 AM »
can't use it with SD, since nothing will fit.
instructions on upg OS are here: http://arduino.cc/en/main/software
but be sure to use firm 1.5 (provided in our github)  otherwise may not work...

Rajwired

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: Some problems with ioT and Arduino
« Reply #10 on: March 02, 2015, 05:09:48 AM »
Hi, I'm having the same problem.
What is supposed to be in the Arduino folder once it's burned to the SD card?

Also, what is the correct syntax to send curl commands using curl for Windows, I just want to test the functionality.

 

Carbonate design by Bloc
variant: carbon
SMF 2.0.12 | SMF © 2016, Simple Machines