Page 1 of 1

A python tool for at command

Posted: Sat Jan 03, 2015 3:38 am
by costaud
This is a python tool which contains the basic at command.
(7.57 KiB) Downloaded 612 times

You can use the at command just like a object operation instead of entering serial command each time.

And since it has a class encapsulation, we can control several at object at the same time and interact between these objects.

step1:run python and import this lib
step2:define a AT object, which is decided by the uart port.
step3:run a single command

This is a ipython sample case:

Code: Select all

In [1]: import at_class as at  #import lib

In [2]: t2=at.at_esp8266(2) #define an instance

In [3]: t2.at_scan_ap()  # use the method

In [4]: t2.at_conn_ap('TP-LINK_3E392E','19881215')
conn TP-LINK_3E392E OK
Out[4]: True

In [5]: t2.at_set_mode(3)
cur mode 3
set mode--->3 OK
Out[5]: True

In [6]: t2.at_get
t2.at_get_ip          t2.at_get_mode        t2.at_get_softap_info
t2.at_get_mac         t2.at_get_mux

In [6]: t2.at_get_ip(0)
Out[6]: ''

In [7]: t2.at_get_ip(1)
Out[7]: ''

In [8]:
t2.at_conn_ap           t2.at_ipsend            t2.at_set_mode
t2.at_get_ip            t2.at_ipserver          t2.at_set_mux
t2.at_get_mac           t2.at_ipstart           t2.at_set_softap
t2.at_get_mode          t2.at_ipstatus          t2.at_set_tcp_server
t2.at_get_mux           t2.at_quit_ap           t2.at_tcp_client_signle
t2.at_get_softap_info   t2.at_rst               t2.at_udp_client_signle
t2.at_gmr               t2.at_scan_ap           t2.at_udp_server_multi
t2.at_ipclose           t2.at_set_ipmode        t2.at_udp_server_signle

or you can run it directly in the script:

Code: Select all

if __name__ == '__main__':
    at_test = at_esp8266(2)
    at_test2 = at_esp8266(5)

This script is just an example, you can change it to fit your application.

Have fun!

Re: A python tool for at command

Posted: Tue May 31, 2022 8:14 pm
by milesstone
I recommend you to download this FM WhatsApp and make your official WhatsApp use even more better.

Re: A python tool for at command

Posted: Mon Sep 05, 2022 9:38 am
by Uchiha
Enjoy this classic card game. spider solitaire 2 suit is a very fun card game, I really love the card games on this site, it's always updated with the best new games for you

Re: A python tool for at command

Posted: Tue Sep 06, 2022 2:58 pm
by thiagogo
This is so amazing, great minds think alike I just wrote a similar post on this topic! You should check it out. run 3