vshymanskyy / TinyGSM

A small Arduino library for GSM modules, that just works
GNU Lesser General Public License v3.0
1.91k stars 709 forks source link

Gibrish in console #516

Open roysG opened 3 years ago

roysG commented 3 years ago

I open your basic sample, When i send regulat AT command, it works. When i send http command, i get gibrish in the response.

The code i sent in console:

AT+CHTTPCREATE=http://www.iforce2d.net/ AT+CHTTPCON=0 AT+CHTTPSEND=0,0,/test.php

`/** *

// Select your modem:

define TINY_GSM_MODEM_SIM7000

// #define TINY_GSM_MODEM_SIM900 // #define TINY_GSM_MODEM_SIM808 // #define TINY_GSM_MODEM_SIM868 // #define TINY_GSM_MODEM_UBLOX // #define TINY_GSM_MODEM_M95 // #define TINY_GSM_MODEM_BG96 // #define TINY_GSM_MODEM_A6 // #define TINY_GSM_MODEM_A7 // #define TINY_GSM_MODEM_M590 // #define TINY_GSM_MODEM_MC60 // #define TINY_GSM_MODEM_MC60E // #define TINY_GSM_MODEM_ESP8266 // #define TINY_GSM_MODEM_XBEE

// Set serial for debug console (to the Serial Monitor, speed 115200)

define SerialMon Serial

// Set serial for AT commands (to the module) // Use Hardware Serial on Mega, Leonardo, Micro //#define SerialAT Serial1

// or Software Serial on Uno, Nano

include

SoftwareSerial SerialAT(4, 5); // RX, TX

define TINY_GSM_DEBUG SerialMon

include

// Module baud rate uint32_t rate = 0; // Set to 0 for Auto-Detect

void setup() { // Set console baud rate SerialMon.begin(115200); delay(6000); }

void loop() {

if (!rate) { rate = TinyGsmAutoBaud(SerialAT); }

if (!rate) { SerialMon.println(F("")); SerialMon.println(F(" Module does not respond!")); SerialMon.println(F(" Check your Serial wiring")); SerialMon.println(F(" Check the module is correctly powered and turned on")); SerialMon.println(F("")); delay(30000L); return; }

SerialAT.begin(rate);

// Access AT commands from Serial Monitor SerialMon.println(F("")); SerialMon.println(F(" You can now send AT commands")); SerialMon.println(F(" Enter \"AT\" (without quotes), and you should see \"OK\"")); SerialMon.println(F(" If it doesn't work, select \"Both NL & CR\" in Serial Monitor")); SerialMon.println(F(""));

while(true) { if (SerialAT.available()) { SerialMon.write((char) SerialAT.read()); } if (SerialMon.available()) { SerialAT.write((char) SerialMon.read()); } delay(0); } }`

SRGDamia1 commented 3 years ago

Were you able to get this to work?