Error in uploading "hello-world" to Tmote Sky on Contiki - msp430

I am new to Contiki and have been trying to do the "hello-world" on the Tmote Sky. I did this by following the steps given on this site: http://anrg.usc.edu/contiki/index.php/Hello_World.
When I run the command:
make hello-world.upload (This will upload the code on the Tmote Sky), the following error appears:
#../../tools/sky/msp430-bsl-linux --telosb -c /dev/ttyUSB0 -r
MSP430 Bootstrap Loader Version: 1.39-telos-7
Use -h for help
Reset device ...
Done
make[2]: Leaving directory `/home/kaybha/Downloads/contiki/examples/hello-world'
make -j 20 sky-upload-sequence
using saved target 'sky'
make[2]: Entering directory `/home/kaybha/Downloads/contiki/examples/hello-world'
+++++ Erasing /dev/ttyUSB0
MSP430 Bootstrap Loader Version: 1.39-telos-7
Use -h for help
Mass Erase...
Transmit default password ...
+++++ Programming /dev/ttyUSB0
MSP430 Bootstrap Loader Version: 1.39-telos-7
Invoking BSL...
Transmit default password ...
Autodetect failed! Unknown ID: f26f. Trying to continue anyway.
Current bootstrap loader version: 2.13 (Device ID: f26f)
Changing baudrate to 38400 ...
Program ...
An error occurred:
Timeout
+++++ Resetting /dev/ttyUSB0
MSP430 Bootstrap Loader Version: 1.39-telos-7
Use -h for help
Reset device ...
Done
make[2]: Leaving directory `/home/kaybha/Downloads/contiki/examples/hello-world'
make[1]: Leaving directory `/home/kaybha/Downloads/contiki/examples/hello-world' #
Any help will be greatly appreciated. Thanks in advance.

Check out this link think this will solve your problem!

Related

mkdir and mount in initramfs

I am writing an initramfs, executed in busybox, in which I mount a partition using those commands:
/bin/busybox mount -n -t proc proc /proc
mount -n -t devtmpfs devtmpfs /dev
mount -n -t sysfs sysfs /sys
mount -n -t tmpfs inittemp /mnt
mkdir /mnt/saved
mount -n -t "${rootfstype}" -o "${rootflags}" ${device} /mnt/saved
But when the system starts up, I have this error:
mount: mounting /dev/mmcblk0p2 on /mnt/saved failed: No such file or directory
I know that when the device is not found, there is a message like Device does not exist, so I think the problem is coming from the directory /mnt/saved that is not correctly created yet.
I tried adding an ls -l /mnt after the mkdir to check that the directory is correctly created, but most of the time, if I do so, the error disappears. So I though the problem might be synchronization problem (of the tmpfs, weird!) So I tried some other things like creating a dummy file in the directory to force a kind of synchronisation. This works, but is a dirty workaround and I want to find the real cause of the problem to build a clean solution.
By the time I was writing my question, I finally found the solution by myself… I post it anyway just in case somebody is stuck like me.
Actually, the mount command of busybox does not show a message about device, if it cannot find it, but always show No such file or directory.
My problem was actually coming from the root device which was not ready yet, and so not in the /dev directory yet. In order to make it work correctly, I simply added this line before the mount:
while ${rootwait} && ! [ -b "${device}" ]; do sleep 1; done

Error happens when trying to umount the Lustre file system

When I umount Lustre FS it displays:
[root#cn17663-ens4 mnt]# umount /mnt/lustre
umount: /mnt/lustre: target is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
and if I add the force option -f it gives the same result:
[root#cn17663-ens4 mnt]# umount /mnt/lustre -f
umount: /mnt/lustre: target is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
When I try to list the directory it gives me :
[root#cn17663-ens4 mnt]# ls
ls: cannot access lustre: Cannot send after transport endpoint shutdown
lustre
and I cannot find what the reason is and cannot solve it.
Did you actually try running lsof /mnt/lustre (as the error message recommends) to see what is using the filesystem? This problem is not unique to Lustre, but true of any local filesystem as well - if there is a process using the filesystem (current working directory or open file) then it can't be unmounted until that process stops using it (cd out of /mnt/lustre or close the open file(s)).
I find I can use umount -l /mnt/xx to solve this problem!

Memory issue with meteor up (mup) on Digital Ocean

I couldn't find existing posts related to my issue. On a Digital Ocean Droplet, mup setup went fine, but when I try to deploy, I get the following error. Any ideas? Thanks!
root#ts:~/ts-deploy# mup deploy
Meteor Up: Production Quality Meteor Deployments
Building Started: /root/TS/
Bundling Error: code=137, error:
-------------------STDOUT-------------------
Figuring out the best package versions to use. This may take a moment.
-------------------STDERR-------------------
bash: line 1: 31217 Killed meteor build --directory /tmp/dc37af3e-eca0-4a19-bf1a-d6d38bb8f517
Below are the logs. node -v indicates I am using 0.10.31. How do I check which script is exiting with the error? Any other ideas? Thanks!
error: Forever detected script exited with code: 1
error: Script restart attempt #106
Meteor requires Node v0.10.29 or later.
error: Forever detected script exited with code: 1
error: Script restart attempt #107
Meteor requires Node v0.10.29 or later.
error: Forever detected script exited with code: 1
error: Script restart attempt #108
stepping down to gid: meteoruser
stepping down to uid: meteoruser
After I went back to an old backup of the DO Droplet, and re-ran mup setup and mup deploy, I now get this in the command line output
Building Started: /root/TS
Bundling Error: code=134, error:
-------------------STDOUT-------------------
Figuring out the best package versions to use. This may take a moment.
-------------------STDERR-------------------
FATAL ERROR: JS Allocation failed - process out of memory
bash: line 1: 1724 Aborted (core dumped) meteor build --directory /tmp/bfdbcb45-9c61-435f-9875-3fb304358996
and this in the logs:
>> stepping down to gid: meteoruser
>> stepping down to uid: meteoruser
Exception while invoking method 'login' TypeError: Cannot read property '0' of undefined
at ServiceConfiguration.configurations.remove.service (app/server/accounts.js:7:26)
at Object.Accounts.insertUserDoc (packages/accounts-base/accounts_server.js:1024)
at Object.Accounts.updateOrCreateUserFromExternalService (packages/accounts-base/accounts_server.js:1189)
at Package (packages/accounts-oauth/oauth_server.js:45)
at packages/accounts-base/accounts_server.js:383
at tryLoginMethod (packages/accounts-base/accounts_server.js:186)
at runLoginHandlers (packages/accounts-base/accounts_server.js:380)
at Meteor.methods.login (packages/accounts-base/accounts_server.js:434)
at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1594)
at packages/ddp/livedata_server.js:648
Exception while invoking method 'login' TypeError: Cannot read property '0' of undefined
at ServiceConfiguration.configurations.remove.service (app/server/accounts.js:7:26)
at Object.Accounts.insertUserDoc (packages/accounts-base/accounts_server.js:1024)
at Object.Accounts.updateOrCreateUserFromExternalService (packages/accounts-base/accounts_server.js:1189)
at Package (packages/accounts-oauth/oauth_server.js:45)
at packages/accounts-base/accounts_server.js:383
at tryLoginMethod (packages/accounts-base/accounts_server.js:186)
at runLoginHandlers (packages/accounts-base/accounts_server.js:380)
at Meteor.methods.login (packages/accounts-base/accounts_server.js:434)
at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1594)
at packages/ddp/livedata_server.js:648
The memory issue stems from using DigitalOcean's $5 Droplet. To solve the problem, I added swap to the server, as explained in detail below.
Create and enable the swap file using the dd command :
sudo dd if=/dev/zero of=/swapfile bs=1024 count=256k
“of=/swapfile” designates the file’s name. In this case the name is swapfile.
Next prepare the swap file by creating a linux swap area:
sudo mkswap /swapfile
The results display:
Setting up swapspace version 1, size = 262140 KiB
no label, UUID=103c4545-5fc5-47f3-a8b3-dfbdb64fd7eb
Finish up by activating the swap file:
sudo swapon /swapfile
You will then be able to see the new swap file when you view the swap summary.
swapon -s
Filename Type Size Used Priority
/swapfile file 262140 0 -1
This file will last on the virtual private server until the machine reboots. You can ensure that the swap is permanent by adding it to the fstab file.
Open up the file:
sudo nano /etc/fstab
Paste in the following line:
/swapfile none swap sw 0 0
Swappiness in the file should be set to 10. Skipping this step may cause both poor performance, whereas setting it to 10 will cause swap to act as an emergency buffer, preventing out-of-memory crashes.
You can do this with the following commands:
echo 10 | sudo tee /proc/sys/vm/swappiness
echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf
To prevent the file from being world-readable, you should set up the correct permissions on the swap file:
sudo chown root:root /swapfile
sudo chmod 0600 /swapfile
This only worked for me by increasing the swap space to 1gb:
Make all swap off
sudo swapoff -a
Resize the swapfile
sudo dd if=/dev/zero of=/swapfile bs=1M count=1024
Make swapfile usable
sudo mkswap /swapfile
Make swapon again
sudo swapon /swapfile

Arduino Tools > Serial Port greyed out

I am running Debian 7 (Linux Crunchbang) and wanted to use The Arduino IDE to program my Arduino UNO. To do that I installed the package arduino. When I started the Arduino I was asked to add my user to the dialout group. So I did with sudo usermod -a -G dialout <my-username>.
However when I start the Arduino IDE using arduino in the commandline the IDE opens but I am not able to load my program to the Arduino. The error message is "Serial port COM1 not found. Did you select the right one from the Tools > Serial Port menu?" And when I went to select the Serial Port, the option "Tools > Serial Port" is greyed out.
I thought it is because I did not grant read and write permissions on my usb port (ttyACM0). So I did sudo chmod a+rw /dev/ttyACM0 but the option is still greyed out.
chdmod works for my under debian (proxmox):
# chmod a+rw /dev/ttyACM0
For installing arduino IDE:
# apt-get install arduino arduino-core arduino-mk
Add the user to dialout group:
# gpasswd -a user dialout
Restart Linux.
Try with the File > Examples > 01.Basic > Blink, change the 2 delays to delay(60) and click the upload button for testing on arduino, led must blink faster. ;)
sudo arduino is the only way I get the Arduino IDE working (serial port and upload) on ubuntu 12.04 (64)
Indeed the serial port to use is /dev/ttyACM0 in my case too.
The other two (ttyS4 and ttyS0) gave an error when trying to upload to Uno.
Have fun
Try Disconnecting the usb and plugging it back in. Its only grayed out because the ide cannot find any com ports that the uno has been plugged into.
another solution is to try all the com ports and see which one works.
finally if all fails try restarting your computer.
Close all instances of the arduino IDE
open ~/.arduino/preferences.txt and look for the line:
serial.port=<not your port>
and change it to your port:
serial.port=/dev/ttyACM0
you may have to log out for it to take effect
open $arduinoHome/arduino in text editor and modify last string:
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base "$#"
to
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dgnu.io.rxtx.SerialPorts="/dev/ttyACMN" processing.app.Base "$#"
(set property gnu.io.rxtx.SerialPorts to /dev/ttyACMN,where ttyACMN is name of serial port which you use)
it may temporary fix bug in rxtx library. helped me to upload sketch with arduino1.0.5 IDE.
Maybe would helpful for someone.
In my case this turned out to be a bad USB hub.
The 'lsusb' command can be used to display all recognized devices. If the unit is not plugged in the option to set the speed will be disabled.
The lsusb command should output something like the string 'Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)' if your device is recognized. Mine was an RFDuino
In my case I solved this issue by uninstalling the version of Arduino that I installed via apt-get and instead installed via the official website.
With the latest version of Arduino I didn't have the problem described on Ubuntu 18.04.
So I did with sudo usermod -a -G dialout <my-username>.
You need to log out after you add yourself to a group so those changes are applied. Just log out and log in again and the menu should be available.
install rx-tx lib for java run this command in terminal
sudo apt-get install librxtx-java -y
output port
sudo usermod -aG dialout $USER
sudo apt-get install gnome-system-tools
help regconize usb device
I solved following serial port related problems in ubuntu 18.04 as follows:
Problem 1 : Cannot open /dev/ttyACM0: Permission denied
Solution : Grant permissions to read/write to the serial port with this terminal command ---> sudo chmod a+rw /dev/ttyACM0
Here replace tty port with your respective ubuntu port.
Problem 2 : Failed to open /dev/ttyACM0 (port busy)
Solution : This problem appears when serial port is busy or already occupied. So kill the busy serial port with command ---> fuser -k /dev/ttyACM0. Here replace tty port with your respective ubuntu port.
Problem 3 : Board at /dev/ttyACM0 is not available
Solution : In this case your serial port in tools menu will be greyed out. I googled a lot for this, but I none of solution worked for me. Atlast I tried different arduino board and usb connector and it was working for me. So, if you are having old arduino board (can be solved using required drivers) or defected arduino board then only this problem arises.
If it is helpful to anyone, I had this problem using Ubuntu 22.04. The issue stemmed from:
apparmor (apparmor denied error, logging with dmesg)
brltty (ch34x converter now disconnected from ttyUSB0)
Solved it by removing both:
https://www.simplified.guide/ubuntu/remove-apparmor
sudo apt remove brltty
You can disable apparmor and it should work, however this made applications like firefox useless. My recomendation would be to totally remove it
Same comment as Philip Kirkbride.
It wasn't a permission issue, but using the Arduino IDE downloaded from their website solved my problem.
Thanks!
Michael
The following steps install the IDE and remove the error java.lang.NullPointerException thrown while loading gnu.io.RXTXCommDriver which usually comes with arduino installed with apt-get command in Ubuntu.
Install the IDE
sudo apt-get install arduino
for removing java error in IDE
sudo add-apt-repository ppa:webupd8team/java
sudo apt update
sudo apt install oracle-java8-set-default
This also shows the Serial Port which was grayed out due to the error.
I had the same problem, with which I struggled for few days, reading all the blog posts, watching videos and finally after i changed my uno board, it worked perfectly well. But before I did that, there were a few things I tried, which I think also had an effect.
Extracted the files to opt folder, change the preference --> behavior --> executable text files --> ask what to do. After that, double clicked arduino on the folder, selected run by terminal
added user dialout like described in other answers.
Hope this answer helps you.
For a Windows solution I've found that disabling and re-enabling the Arduino in Device Manager, then restarting the Arduino IDE does the trick without fail (no unplugging necessary). Why this error occurs in the first place is beyond me. Perhaps the corresponding method for Linux will fix your problem.
Slightly related (not really), I had an issue with an AVR board a while back which was fixed by setting the device to a new COM port in the driver settings. Again, however you linux bunnies do it, I'm sure it'll be cookies and cream.
Cheers brother,
I encountered the same issue. My solution was to install and use java7:
sudo apt-get install openjdk-7-jre
sudo update-alternatives --config java
Select the number referring to the java-7 path.
You probably don't have the correct permissions. Try adding yourself to these groups.
sudo adduser username ttyl
sudo adduser username serial
sudo adduser username uucp
Then restart your system and check if you got added to the groups.
groups username
Good Luck!
Try to run as an administrator...
Run terminal, type sudo arduino, type your root password, and... :)

Can´t upload code to Arduino Uno using stino and Ubuntu 12.04 (Precise Pangolin)

I have installed stino on Sublime Text 2 succesfully, but when I try to upload my code to Arduino Uno, the output is the following:
Uploading /home/lucas/Arduino_Build/programa_teste/programa_teste.hex to Arduino Uno...
avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
ioctl("TIOCMGET"): Inappropriate ioctl for device
[Stino - Error while uploading.]
I have the Arduino IDE installed, and it is working fine, only Sublime Text can´t upload the code.
well, as #Bibhas says, your problem is that /dev/ttyACM0 is having the wrong permissions, and that has nothing to do with Arduino or sublime text. It's the linux kernel who creates character devices per default with no user permissions.
But good thing is that it can be changed!
The fast and easy solution is to add your current user to the dialout group:
sudo adduser YOU dialout
where YOU is your username and then log out and log back in to have those new permissions propagated into your shells.
Hint:
There's a solution that is a bit more complicated, is to create a udev rule such as:
/etc/udev/rules.d/48-arduino.rules
SUBSYSTEM!="usb_device", ACTION!="add", GOTO="arduino_end"
SUBSYSTEM=="tty", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0036", MODE="660", GROUP="arduino", SYMLINK+="arduino.leonardo"
LABEL="arduino_end"
which creates a /dev/arduino device readable and writable by the arduino group, that you need to create (or you can use the default dialout group which is perfectly fine):
addgroup arduino
adduser YOU arduino
and then reload your rules:
sudo udevadm control --reload-rules
The nice thing about that second hint is that when you unplug replug your arduino, you won't have it change device number oddly, it will be kept to the name. If you're not using an arduino leonardo, you can check your device idvendor/idproduct using lsusb:
% lsusb
… ↓↓↓↓ ↓↓↓↓
Bus 006 Device 105: ID 2341:0036 Arduino SA
…
HTH
Accoding the Troubleshooting doc, I use
sudo usermod -a -G tty yourUserName
sudo usermod -a -G dialout yourUserName
fix my problem.
I have the same problem today, and the incredible happend. The USB cable gave power to the Arduino, but doesn't allow the communication. The solution for us was to change the USB cable, and after that everything worked

Resources