Comunication via UART ESP32 <- ->Thingy:91

I'm using the Nordic Thingy:91 and my goal is to send AT commands via UART from ESP32 with Micropython to the thingy:91, in order to send data to PHP file located on a server.

I have the Thingy:91 programed with basic thingy91_fw_2023-03-02_8f26142b\img_fota_dfu_hex\thingy91_serial_lte_modem_2023-03-02_8f26142b.hex and using the SLM AT commands.

I send the AT commands via UART but I dont recieve response, and it doesn't work.

Do I need to reprogram the Thingy:91 to activate the UART?
Does Thingy:91 has UART pins? Actually I'm using a USB UART <-> Serial  

My setup is the following:

import machine, time
import thingy

uart=machine.UART(2,115200)
at=thingy.THINGY_91(uart)

at.config_Internet()

URL_TO_PHP="my php address"
data="55"

at.send_data_server(URL_TO_PHP,DATA)

from machine import UART

import time

class THINGY_91():
    def __init__(self,uart):
        self.UART = uart
        print("INICIALIZADO")

    def send_command(self,command):
        time.sleep_ms(1)
        self.UART.write(str(command))
        time.sleep(1)
        print(self.UART.read())
    
    def config_Internet(self):
        self.send_command("AT+CFUN=1")
        time.sleep(1)
        self.send_command("AT+CFUN?")
        time.sleep(1)
        self.send_command("AT+COPS=?")
        time.sleep(300)

    def send_data_server(self,url,data):
        datos='AT#XHTTPCREQ="GET",'+str(url)+str(data)
        time.sleep_ms(1)
        self.send_command('AT#XHTTPCCON=1,SERVER_IP_ADDRESS,80"')
        time.sleep(1)
        self.send_command(str(datos))
        time.sleep(30)
Thanks for all
Parents
  • Hi

    the Thingy91 is not a USB host so it is not possible with the TTL-USB adapter. 

    "Do I need to reprogram the Thingy:91 to activate the UART?
    Does Thingy:91 has UART pins? Actually I'm using a USB UART <-> Serial  "
    I had a look on there is not easy accessibly UART pins on the thingy91. However if we look at the p6 connector it has "spare" GPIO pins connected to the nrf5240. So it should be possible to use configure two of them as UART pins and pass the data over to the nrf9160. So the short answer to both your questions is yes, but its not straight forward. The Thingy 91 is not designed for developing additional sensor on and is more of a closed solution for testing systems and the onboard sensor. 
    But if you want to proceed with this solution you can read through this thread

    My recommendation for development would be to get a nRF9160DK where you can access the GPIO pins and you have a debugger. 

    Regards

    Runar

Reply
  • Hi

    the Thingy91 is not a USB host so it is not possible with the TTL-USB adapter. 

    "Do I need to reprogram the Thingy:91 to activate the UART?
    Does Thingy:91 has UART pins? Actually I'm using a USB UART <-> Serial  "
    I had a look on there is not easy accessibly UART pins on the thingy91. However if we look at the p6 connector it has "spare" GPIO pins connected to the nrf5240. So it should be possible to use configure two of them as UART pins and pass the data over to the nrf9160. So the short answer to both your questions is yes, but its not straight forward. The Thingy 91 is not designed for developing additional sensor on and is more of a closed solution for testing systems and the onboard sensor. 
    But if you want to proceed with this solution you can read through this thread

    My recommendation for development would be to get a nRF9160DK where you can access the GPIO pins and you have a debugger. 

    Regards

    Runar

Children
No Data
Related