Hello ,
I'm trying to create a syntax which allow me to copy in an instance T=1.5s a data from micropython terminal like ("Webrepl or teraterm ) and send it to specific file like txt or another type but I couldn't find the key to start this properly
Anyone can light me on this ?
B.R
samerou
ESP8266/MicroPython-Copy data from terminal to file
-
- Posts: 847
- Joined: Mon Nov 20, 2017 10:18 am
Re: ESP8266/MicroPython-Copy data from terminal to file
Open a file and write it to file
Re: ESP8266/MicroPython-Copy data from terminal to file
@samerou: On which deviec do you want to write:
a) do you want to write data sent by the ESP8266 into a file on the PC, or
b) do you want to write data sent by the PC into a file on the ESP8266
In case of a) at least with programs like Tertarm, you can open a log file, which capture all activity. In case of b), like @OutoftheBOTS_ told, open a file and write to it everything you receive by reading from sys.stdin.
a) do you want to write data sent by the ESP8266 into a file on the PC, or
b) do you want to write data sent by the PC into a file on the ESP8266
In case of a) at least with programs like Tertarm, you can open a log file, which capture all activity. In case of b), like @OutoftheBOTS_ told, open a file and write to it everything you receive by reading from sys.stdin.
Re: ESP8266/MicroPython-Copy data from terminal to file
[quote=Roberthh post_id=34182 time=1550386690 user_id=601]
@samerou: On which deviec do you want to write:
a) do you want to write data sent by the ESP8266 into a file on the PC, or
b) do you want to write data sent by the PC into a file on the ESP8266
In case of a) at least with programs like Tertarm, you can open a log file, which capture all activity. In case of b), like @OutoftheBOTS_ told, open a file and write to it everything you receive by reading from sys.stdin.
[/quote]
@Roberthh, thank you for answering me ,
I'm looking for case a : exporting data from esp terminal(Teraterm ,Upyloader ,Webrepl) into PC
So what are you saying that there is a file "log" that records everything displayed in terminal ? where should I find it ?
Is there away to export data from Terminal in specific location defined by me and different type of file like (CSV, TXT,....) ?
@samerou: On which deviec do you want to write:
a) do you want to write data sent by the ESP8266 into a file on the PC, or
b) do you want to write data sent by the PC into a file on the ESP8266
In case of a) at least with programs like Tertarm, you can open a log file, which capture all activity. In case of b), like @OutoftheBOTS_ told, open a file and write to it everything you receive by reading from sys.stdin.
[/quote]
@Roberthh, thank you for answering me ,
I'm looking for case a : exporting data from esp terminal(Teraterm ,Upyloader ,Webrepl) into PC
So what are you saying that there is a file "log" that records everything displayed in terminal ? where should I find it ?
Is there away to export data from Terminal in specific location defined by me and different type of file like (CSV, TXT,....) ?
Re: ESP8266/MicroPython-Copy data from terminal to file
There is an option in Teraterm to log all interface activity in a file, under File->Log. This is just the raw character stream. I do not expect that this is possible with Webrepl.
If you are using simple tools like picocom or screen form the command line, you can always "tee" the screen output to a file, like:
picocom -b 115200 -p /dev/ttyUSB0 | tee my_logfile.txt
If you are using simple tools like picocom or screen form the command line, you can always "tee" the screen output to a file, like:
picocom -b 115200 -p /dev/ttyUSB0 | tee my_logfile.txt
Re: ESP8266/MicroPython-Copy data from terminal to file
Thank you so much I'm gonna accept this as answer ,Roberthh wrote: ↑Sun Feb 17, 2019 4:22 pmThere is an option in Teraterm to log all interface activity in a file, under File->Log. This is just the raw character stream. I do not expect that this is possible with Webrepl.
If you are using simple tools like picocom or screen form the command line, you can always "tee" the screen output to a file, like:
picocom -b 115200 -p /dev/ttyUSB0 | tee my_logfile.txt
Have a nice day
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: ESP8266/MicroPython-Copy data from terminal to file
I created a little logging program that puts the time in front of the device output. If you are interest I can post it. Or actually it is already here: https://github.com/kevinkk525/micropyth ... _logger.py Just have to adapt it to not write something to the repl if that could conflict with your program. It's started from commandline with first arg is the port, 2nd arg is the statement you want to write to repl (e.g. to start some program) and 3rd arg is if it should write something to the repl or just listen.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Re: ESP8266/MicroPython-Copy data from terminal to file
kevinkk525 wrote: ↑Mon Feb 18, 2019 9:35 amI created a little logging program that puts the time in front of the device output. If you are interest I can post it. Or actually it is already here: https://github.com/kevinkk525/micropyth ... _logger.py Just have to adapt it to not write something to the repl if that could conflict with your program. It's started from commandline with first arg is the port, 2nd arg is the statement you want to write to repl (e.g. to start some program) and 3rd arg is if it should write something to the repl or just listen.
[/quote
@kevinkk525 , Thank you so much I'm open to any kind of example