Search found 9 matches

by ghusson
Mon Jan 29, 2018 2:19 pm
Forum: MicroPython pyboard
Topic: best approach for an application config file
Replies: 16
Views: 27524

Re: best approach for an application config file

After reading this post, I wrote a sample class here under. Feel free to share, test, enhance ! Example : my_jsonfile = jsonfile("./test.json", default_data = {"a": "porty", "b": "portx"}) print(my_jsonfile.get_data()) update_data = {"c": "portc", "b": "portb"} my_jsonfile.update_data_dict(update_da...
by ghusson
Mon Jan 29, 2018 11:00 am
Forum: General Discussion and Questions
Topic: problem with ampy, one code can't be sent
Replies: 2
Views: 4446

Re: problem with ampy, one code can't be sent

Indeed I know all that, but thank you to remember that.
I think I had no task printing some things and that my line was clear.
Anyway, I now use Loboris integrated framework with his FTP server, thus I don't have this problem anymore :-)
Thank you,
Gautier.
by ghusson
Fri Jan 26, 2018 3:33 pm
Forum: General Discussion and Questions
Topic: _threads, sockets and interruption with ESP32
Replies: 10
Views: 16946

Re: _threads, sockets and interruption with ESP32

Roberthh : Thank you ofr sharing your experience. For information, I was working on a code derived from your work :-) I found here : https://github.com/lemariva/uPyPortal/blob/master/ftp.py I wanted to have it managed by a background thread and with automatic restart. No way to do this rock solid in...
by ghusson
Fri Jan 26, 2018 1:00 pm
Forum: General Discussion and Questions
Topic: _threads, sockets and interruption with ESP32
Replies: 10
Views: 16946

Re: _threads, sockets and interruption with ESP32

Thanks for confirming that I will have less headaches with Loboris micropython :-) Telnet and FTP per default is what I am looking for. Thank you for the reload code, it helps me ! In return, this is a scipt I use in linux command line with lftp. It uses size of files for syncing. But with loboris a...
by ghusson
Fri Jan 26, 2018 12:54 pm
Forum: General Discussion and Questions
Topic: problem with ampy, one code can't be sent
Replies: 2
Views: 4446

problem with ampy, one code can't be sent

Hello, I try to send code here under. But ampy ends in error. Version used : ampy, version 1.0.3 Do you have an idea ? Thank you. Error : ampy --port /dev/ttyUSB0 --baud=115200 put tools.py Traceback (most recent call last): File "/usr/local/bin/ampy", line 11, in <module> sys.exit(cli()) File "/usr...
by ghusson
Fri Jan 26, 2018 10:27 am
Forum: General Discussion and Questions
Topic: _threads, sockets and interruption with ESP32
Replies: 10
Views: 16946

Re: _threads, sockets and interruption with ESP32

Ok, thank you for your answers. I am rather new to Python and totally new on Python. I wrote some test code here under. The filename is "test_threaded_socket.py". I have some questions... 1) Why __name__ returns the python file less ".py" rather than main ? 2) I think it is normal but surprising tha...
by ghusson
Thu Jan 25, 2018 3:26 pm
Forum: General Discussion and Questions
Topic: _threads, sockets and interruption with ESP32
Replies: 10
Views: 16946

Re: _threads, sockets and interruption with ESP32

Yes, understood. I made a mistake, I wanted to speak of Ctrl + D. Anyway, in a background thread, the Ctrl + C is not caught. The Ctrl + D is not caught either. In my example, the previously ran thread is not interrupted, and a next run of the thread fail in binding the sockets. Do you have an idea ?
by ghusson
Thu Jan 25, 2018 2:32 pm
Forum: General Discussion and Questions
Topic: _threads, sockets and interruption with ESP32
Replies: 10
Views: 16946

Re: _threads, sockets and interruption with ESP32

I don't know if I am doing something wrong, but is seems that the except is not reached in a "background" running thread when I do a Ctrl+C on the Python command line...
by ghusson
Tue Jan 23, 2018 4:47 pm
Forum: General Discussion and Questions
Topic: _threads, sockets and interruption with ESP32
Replies: 10
Views: 16946

_threads, sockets and interruption with ESP32

Hello, I am trying to stabilize a FTP server I found here : https://github.com/lemariva/uPyPortal For that, I loop on client connection. But, when doing Ctrl + C on the python console, the thread doesn't exit properly. It seems to be running in the background of the os (but in a bad state because FT...