A python tool for at command

Posts: 138
Joined: Fri Oct 24, 2014 7:40 pm

A python tool for at command

Postby costaud » Sat Jan 03, 2015 3:38 am

This is a python tool which contains the basic at command.
(7.57 KiB) Downloaded 601 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
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!

Posts: 143
Joined: Mon Apr 26, 2021 4:50 pm

Re: A python tool for at command

Postby milesstone » Tue May 31, 2022 8:14 pm

I recommend you to download this FM WhatsApp and make your official WhatsApp use even more better.

Posts: 4
Joined: Wed Dec 29, 2021 4:58 pm

Re: A python tool for at command

Postby Uchiha » Mon Sep 05, 2022 9:38 am

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

Posts: 5
Joined: Mon Jan 10, 2022 11:42 am

Re: A python tool for at command

Postby thiagogo » Tue Sep 06, 2022 2:58 pm

This is so amazing, great minds think alike I just wrote a similar post on this topic! You should check it out. run 3

Who is online

Users browsing this forum: No registered users and 2 guests