How can I upload binaries on n Arduino UNO R3? - arduino

I have an Arduino Uno and I would like to upload a .bin file.
I have found an answer on Google which recommends that I use IAR to upload the binary, but my PC has very low memory.
I have tried doing it via terminal
sudo cp ./blinky.bin /media/edwin/UNO/
But I'm getting an odd error saying that the board is not found.
Are there any suggestions?

I managed to find out that on Linux, we have to mount media devices before we can send files to them.
I used
sudo mount /media/Edwin/UNO/
And I have found that if we open the device in the file manager, it mounts automatically.
In terms of copying, I found that we could also drag a file to the destination in the file manager.
This makes it soo easy!

Related

Arduino distributable program file

Similar to an .exe file, is there a way to make a 'distributable' of an Arduino program? Some sort of ready-to-upload file... I'd like to share the program but the code should be kept the most secret as possible, or at least make it hard to know.
You can distribute the .hex binary file, and then let the users upload the binary on the Arduino themselves.
The ordinary Arduino IDE already does that for you when you click on the button verify & upload, so you simply have to take the generated .hex file and give it away.
Or you can use Arduino Makefile to get your .hex binaries using any other development environment.
Note: even though the source code is not included nor displayed, it is possible to reverse engineer an .hex binary as much as it is possible to do it with an .exe binary.

Arduino Mega2560 can't be programmed repeatedly using avrdude

I have a sketch for a mega2560 board that I can upload successfully using the Arduino IDE using the upload button but I would prefer to use a script using avrdude. The only problem is if I try to run avrdude more than once to flash the board it get's a stk500v2_ReceivedMessage(): timeout. It doesn't happen every time but enough. The only way the avrdude seems to work again is if I update the same sketch using the Arduino IDE.
I was having trouble finding what the Arduino IDE does to upload a file but all the settings I could find suggest that avrdude is doing it the same way.
Verbose compilation and upload can be enabled in Arduino IDE Settings:
File->Preferences->Show verbose output during: [] compilation [x] upload.
It will show complete commands used for upload and the avrdude should be same or you can use the same avrdude.exe. You should see something like:
C:\arduino\hardware\tools\avr/bin/avrdude -CC:\arduino\hardware\tools\avr/etc/avrdude.conf -v -V -patmega2560 -cwiring -PCOM17 -b115200 -D -Uflash:w:C:\Users\kiiv\AppData\Local\Temp\build658cdf44885ca2a8676f164a933c092f.tmp/MAX7219_4x4x4.ino.hex:i
BTW: I've just started with PlatformIO CLI (command line tool) and I'm loving it.
PlatformIO IDE didn't work well for me, as I'm using czech keyboard layout and keystrokes prevents me to write all essential characters like []{}#& without switching it to english one.

Using SCP to move a file from windows desktop to a hadoop sandbox on vmware

I think this is simple but I would really appreciate your help. I have a zip file on my windows desktop "RECEIPTS_LAB.zip" and I am running a hadoop sandbox on vmware. The sandbox is part of a training course I signed up for with mapr but I am a beginner and not sure how to move the zip file from windows to the directory in sandbox which is"/user/user01/3"
The manual uses the following code
scp RECEIPTS_LAB.zip user01#node-ip:/user/user01/3
node-ip is the ip address that I got when starting the sandbox, lets assume its 192.168.88.128
When I write the following command:
scp RECEIPTS_LAB.zip user01#192.168.88.128:/user/user01/3
And the error I get is: "RECEIPTS_LAB.zip: No such file or directory"
Please help me understand what should I do since I have tried a lot of times to modify the syntax but I still get the same error
Your error means that you are in the wrong directory.
Have you tried using WinSCP? It will give you an interface that lets you see both your computer directory and the remote computer (in this case the MapR VM) directory.
( https://winscp.net/eng/download.php )
It may make your life easier. Just download the "Portable executables" files from the website and unzip it.
since I am not seeing any port forwarding with your scp command and you are providing an actual IP address I will assume that MapR is running a sandbox with the network adapter in bridge mode.
Double click the application once it is unzipped to start it.
Then on the start up screen provide the
MapR user for user
MapR password for password
The IP address of the sandbox for the "host"
make sure the protocol is set to SCP in the combo box at the top above where you enter credentials
You shouldn't have to touch the port number if MapR's tutorial didn't have a -p switch with the scp call.
if the sandbox is at the IP address you gave and you entered the credentials right, WinSCP will load a side by side directory view of your windows machine and the sandbox. from the side by sode screen you can drag and drop between the machines.
If I understand correctly, you are trying to execute scp RECEIPTS_LAB.zip user01#node-ip:/user/user01/3 from a Windows command prompt. You don't say what version of Windows you are using or which Windows directory you are in when you try to run this command. But as written, it will succeed only if you are in the same directory as the file. If you do not specify a particular directory for the file, Windows looks for it in your current directory. Try this:
Press Windows-Key+R to open the "Run" dialog. Enter "cmd" and click "OK".
Now you should be at a command prompt in your Windows home directory -- something like
C:\Users\Musmar>
Your Desktop folder should be a sub-directory of your home directory -- something like
C:\Users\Musmar\Desktop
To verify this, type:
dir Desktop\RECEIPTS_LAB.zip
Hopefully you will see a directory listing for your file. Then type:
scp Desktop\RECEIPTS_LAB.zip user01#192.168.88.128:/user/user01/3
If my assumptions are correct, that should do what you want or at least get you one step closer.
There are some errors in the Documents of MapR.
ERRORS: Permission denied (publickey,password).
First go the the directory where the zip file is present through he terminal.
Mention the port through which you need the file to be copied.
the port that sandbox allows us is 2222. Default port 22 wont work
scp -P 2222 RECEIPTS_LAB.zip #:/user/user01/3
***Again there might be some problem with your scp. so you might uninstall and reinstall the scp client and then try this.

How to play an audio-cd with Phonon?

I am trying to play an audio CD with phonon under Windows. I use Qt 4.8.0.
I run a code like:
QString filepath = QString("E:\\")
myMusic = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource(Phonon::Cd, filepath));
myMusic->play();
There are any errors in the log window and any sound either. The disk does not spin in drive too.
So is there an option to play audio CD with phonon? If it is, how can I select proper track?
P.S. MP3 is played without issues
Ok, I think I have solved this issue. Currently I have code like this:
Phonon::MediaObject *myMusic = Phonon::createPlayer(Phonon::MusicCategory,Phonon::MediaSource Phonon::Cd, QString("E:\\")));
Phonon::MediaController myMediaController(myMusic);
myMediaController.setAutoplayTitles(true);
myMediaController.setCurrentTitle(7);
myMusic->play();
"E:\" is my cd-drive with inserted audio cd and I play the track #8 (track count starts from zero).
Other issue on my Windows 7 system was Phonon warning:
unable to load the TOC from the CD
This issue is related to Phonon Windows backend. Some Windows systems do not have CDDA codecs (or what is that thing is) installed. In this case Phonon application will not play Audio CD discs. You won't see any errors (except from above) and there won't be any cd drive activity.
To fix this issue you should:
Dowload proper cddareader.ax for your system (I used one from MPC HomeCinema Standalone Filters on http://sourceforge.net/projects/mpc-hc/files/)
Open command line and execute regsvr32.exe cddareader.ax
Reboot
This code is tested on WinXP x86 and Win7 x64. Linux machine have played audio cd without problems (with different path of cource)
Hope this information will be useful

Moving a Java JAR file to a new machine

I have a Java program that connects to com ports when it's running. All I have is a .JAR file. I recently attempted to move this from a machine that the program runs on to another machine. I know the serial devices work on the new machine because I can interact with them thru a program called Putty. When I execute the .JAR file it comes up and seems to run just fine, but is unable to connect to the com port. Could this be a missing library that is installed in the JRE of the other machine? How would I figure out what is missing to make this program run?
Yes that could very well be the problem. Legacy ports (parallel and serial port) support in Java is provided by the Java Communications API, which relies on native code to support low level access to those ports. That API it's an extension to the JDK and not part of it.
Of course it could also be that on the new machine the user running your program doesn't have permissions to access the port, which is a different problem.
EDIT: For cross platform support for legacy ports, hell even if you only intend to use your program in one platform I recommend RXTX, an open source replacement for JavaComm.
Open the jar, look at META-INF/MANIFEST.MF file to see if it specifies any jar dependencies.
If not, it is possible that the JAR is using some native libraries to connect to COM ports.
Using the Serial port with Java normally involves addition of a compiled native (.so or .dll) file to the LD_LIBRARY_PATH.
I think you're using Linux, so look out for a file called librxtxSerial.so on the original machine (it'd be called rxtxSerial.dll on Windows)
The library path can be set in a few ways, but your best bet is to check for this file within the original Java installation:
e.g. /jre/lib/i386/librxtxSerial.so
Another thing to look out for is the rxtx jar itself (this may have been bundled inside your jar, or maybe not).
You may get better results by simply following instructions on the RXTX website, but I'd try understanding the original installation first.
http://rxtx.qbang.org/wiki/index.php/Installation
Good luck!

Resources