Skip to content

Ground module logs

enriquevilla edited this page Feb 28, 2022 · 2 revisions

Once you enter the MicroPython REPL and have pressed Ctrl+D to restart the program, the logs should be similar to the ones attached here.

Entries in angle brackets (< and >) are variable and will be different depending on your setup.

Usual initialization logs:

MPY: soft reboot
UART(0, baudrate=115200, bits=8, parity=None, stop=1, tx=12, rx=13, txbuf=256, rxbuf=256, timeout=5000, timeout_char=1, invert=None)
CMD: AT
resp:
AT

OK

CMD: AT+CWMODE=1
resp:
AT+CWMODE=1

OK

CMD: AT+CWJAP="<WiFi SSID>","<WiFi password>"
resp:
AT+CWJAP="<WiFi SSID>","<WiFi password>"
WIFI DISCONNECT
WIFI CONNECTED
WIFI GOT IP

OK

CMD: AT+CIFSR
resp:
AT+CIFSR
+CIFSR:STAIP,"<Ground Module IP>"
+CIFSR:STAMAC,"<Ground Module MAC Address>"

OK

CMD: AT+CIPMUX=0
resp:
AT+CIPMUX=0

OK

CMD: AT+CIPSTART="TCP","<TapAPI IP>",<TapAPI port>
resp:
AT+CIPSTART="TCP","<TapAPI IP>",<TapAPI port>
CONNECT

OK

CMD: AT+CIPSEND=51
resp:
AT+CIPSEND=51

OK
> 
+IPD,193:HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 48
Server: Werkzeug/2.0.2 Python/3.9.9
Date: Mon, 28 Feb 2022 15:19:49 GMT

{
  "api_version": 0.1, 
  "status": "online"
}
CLOSED

SYSTEM INITIALIZATION COMPLETE

When an RFID card is detected with a valid JWT (this was with a test card):

Card detected (uid=[0x4B, 0x69, 0x2D, 0x0C])
Read a JWT from RFID.
{'jwt': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJncmFkZSI6MTIsIm5hbWUiOiJFbnJpcXVlIE1pZ3VlbCBKb3NlIEUuIFZpbGxhIiwidXVpZCI6IjIxNzU0ZjFiLWY4OGEtNDkzZS05ZjBlLTgyNGJmZDNkNmViNSIsInBhc3MiOiJIZWRjZW45MiJ9.e_0WX3Tlg3ZqWtnlUxrdOggxc2nToNvcqCD6QTCKVx3oe5EPA7nJMz5uDosFrGShf6AkPBicn4Wf_IssCpE1wT0LhoTO_JzDOQluNZkiZepsBdoszcde59Em9oighf0xIaWr3SS0E5bJlh6w1R3cCdV5hfx4XfoiXuTuT-PB9MkNHg_AV1QXAvQ0EqNm4U6ZZmK2ZWR3XSKlTjLNfYwjcnigfsizse5KltZggIsJcrmGGaUKhJFwFv_VBIzJ8fAP_0fuRIbgwjvLhOlkasHfdLCky0-24g2IlgpqBSp1Xy7capcPDf04PsCIB_DmW3ZkE-3t9MFlTwmMFXewK8QWbA', 'uid': '4B 69 2D 0C', 'event_name': 'example_event', 'event_data': {'test': 'data', 'hello': 'world'}}
CMD: AT+CIPSTART="TCP","192.168.100.7",8000
resp:
AT+CIPSTART="TCP","192.168.100.7",8000
CONNECT

OK

CMD: AT+CIPSEND=770
resp:
AT+CIPSEND=770

OK
> 
+IPD,368:HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 222
Server: Werkzeug/2.0.2 Python/3.9.9
Date: Mon, 28 Feb 2022 15:20:26 GMT

{
  "echo": {
    "hello": "world", 
    "test": "data"
  }, 
  "hello": "world", 
  "jwt_decoded": {
    "grade": 12, 
    "name": "Enrique Miguel Jose E. Villa", 
    "uuid": "21754f1b-f88a-493e-9f0e-824bfd3d6eb5"
  }
}
CLOSED

RECV:
Response(
    headers={'response_code': '200', 'Content-Type': 'application/json', 'Date': 'Mon, 28 Feb 2022 15:20:26 GMT', 'Server': 'Werkzeug/2.0.2 Python/3.9.9', 'Content-Length': '222'}
    body={'echo': {'test': 'data', 'hello': 'world'}, 'jwt_decoded': {'grade': 12, 'uuid': '21754f1b-f88a-493e-9f0e-824bfd3d6eb5', 'name': 'Enrique Miguel Jose E. Villa'}, 'hello': 'world'}
)
Done processing.