2

I have an analog sensor which I want to send data from my Arduino Certified Intel Edison to PC, without using a Serial Monitor and preferably putting the data into a text file.

  • What do you mean by "serial monitor"? The serial monitor is an application used to.. well, monitor the serial port. Once you can see that the data is correct, you should develop your own application to get the serial data and do what you need. Anyway you used wrong tags for your question (arduino-uno and arduino-mega) and.. The edison is an Intel board, not an Arduino.. – frarugi87 Mar 21 '16 at 10:09
1

I believe you are looking for something like the Telemetry library.

Full disclaismer : I am the author

It allows you to send string, numbers, arrays, sparse arrays through the serial port for instance. Each sent data has a label, called topic, that is used to identify it.

The Pytelemety command line interface then allows you to connect to the serial port, plot received data in real time, write parameters to reconfigure the arduino from the computer, etc.

Example of arduino code thats send an incrementing counter

#include <Telemetry.h>

Telemetry TM;
int8_t counter;

void setup() {
  TM.begin(115200);
  counter = 0;
}

void loop() {
  TM.pub_i8("count",counter);
  counter++;
  delay(10); 
}

Overview of the CLI (Command-Line Interface) enter image description here

Overview of a graph (not produced by the arduino program above) enter image description here

Output to file is not implemented yet, although all received data is logged to a file (but this log also contains system information). However, this is an interesting feature, quite straightforward to implement, that I might add in coming days if you are interested.

Central documentation is available here.

  • 2
    This looks interesting, thanks for posting. – CharlieHanson Mar 22 '16 at 9:59
  • As the author of the arduino eclipse plugin I want to state that the arduino eclipse plugin has a 6 channel plotter/scope. Also Arduino IDE has a 1 channel plotter/scope. I know there are plenty other similar and advanced tools around. Because there are so many better alternatives to your proposal I'm downvoting this answer as to biased. – jantje Mar 22 '16 at 11:40
  • 1
    @jantje So many better alternatives to my proposal... ? So you haven't even tested what I propose, how can you know what is better exactly ? You have a similar project, that is cool I respect that. However, there are features in my repo that will be extremely hard or even impossible to find anywhere else. Like supporting array data for instance. Or being able to monitor in real time amount of received characters, corrupted frames, to detect issues on the arduino with undersized buffer, too high data throughput. And finally, this project is not tied to Arduino. Runs on Mbed too. – Overdrivr Mar 22 '16 at 13:08
  • 1
    @jantje so please next time you decide to talk about an open-source project, please get informed first, test it and forge your own opinion. And if you find a better alternative, post it, simple as that. Let the people decide. But you should know that I'm not particularly fond of reiventing the wheel. If I developped this project, it is simply because I haven't found an existing solution that would satisfy me. – Overdrivr Mar 22 '16 at 13:21
0

There are a couple of ways you can communicate between a "Arduino' and a "PC"*.

1)Serial communication.

A serial port on your system is created and a program that reads and writes to the serial port is used as communication.
A program that does this is the "serial monitor" which comes in many flavours.
In linux dumping serial monitor incoming data to a file is as easy as:

cat /dev/ttyS0> myFile

2)Bluetooth (LE)
Bluetooth is a low energy consuming protocol that is commonly used for communication between a PC and a "device". The LE uses even less energy. I'm not aware of any "official Arduino" boards that contain the hardware for Bluetooth on board.

3) Network
Today network equals to WIFI of tcpip. These methods allow for huge distances between the pc and the device.

Of these methods the serial communication over USB is the best know because -in Arduino world- this method is most commonly used to upload the "sketch" to the "Arduino". As such all hardware is commonly available.

*I put quotes around Arduino and PC because in perspective of this answer both arduino and PC are to be interpreted as a device containing a cpu.

  • You seem to be missing the point of the question, mixing up protocol with physical layer, while OP is clearly asking for a software alternative to the serial monitor. – Overdrivr Mar 22 '16 at 13:10
  • @Overdrivr. I disagree on me missing the point of the question. OP states he does not want to use the serial monitor. OP does not state the serial port is a must. You make the assumption he wants to use the serial port, I do not. Personally I think OP is not aware the serial monitor is using the serial port. Nor is OP aware that there are other ways to communicate. But the way the question is asked the serial port is not a must. Therefore I included other protocols in my answer just as other serial port programs. – jantje Mar 22 '16 at 14:40
  • @Overdriver I guess you downvoted this answer as: "not related to the question". As stated in the comment above: I disagree. – jantje Mar 22 '16 at 14:42
  • Well, in this case we'll have to agree to disagree :) The question is not exactly clear either, so I don't see how we could do more. – Overdrivr Mar 22 '16 at 15:05
  • Regarding our other conversation, I am very open to a friendly and constructive discussion on the chat or by email regarding your opinion on the Telemetry library, and what strongpoints/weaknesses you feel it has, if you're interested. Let me know. – Overdrivr Mar 22 '16 at 15:08
0

I know, I'm late, but I recommend, using python, as I most always do. The serial module is part of the basic python installation

import serial

S = serial.Serial('/dev/tty/USB0', 115200, timeout=1)

S.write("Hello")
print S.readline()

Should echo Hello, if the arduino sketch replies all incoming data.

Very handy in combination with ipython, where one can interactively poke around with the serial connection object.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.