Arduino telnet client problem no response but connection ok

40 views
Skip to first unread message

Gab Gab

unread,
Dec 3, 2024, 10:24:25 AM12/3/24
to Gqrx SDR
Hi everyone!

I created an Arduino sketch to connect to the GQRX, the connection is ok,
with Arduino Ethernet and Raspberry (GQRX runs here)
but no message seems to arrive at the server.
With the client I send the command f for the frequency

Some friends have some ideas, I'll attach the code. thanks gab gab
#include <SPI.h>

#include <Ethernet.h>

// Replace with your network settings
byte mac[] = {
  0xDE,
  0xAD,
  0xAA,
  0xEF,
  0xFE,
  0xED
};
IPAddress ip(192, 168, 100, 82);
IPAddress server(192, 168, 100, 66); // Replace with your server's IP
unsigned int serverPort = 7356;


EthernetClient client;

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);

  // Initialize Ethernet interface
  Ethernet.begin(mac, ip);
}

void loop() {
  // Connect to the Telnet server
  if (Serial.available() > 0) { // Check if there's incoming data
    char incomingByte = Serial.read(); // Read the incoming byte

    // Do something with the incoming byte
    if (incomingByte == 'f') {  //get current frequency
      if (client.connect(server, serverPort)) {
       
        Serial.println("connected");
        delay(600);
       client.println( incomingByte);
         delay(600);        
        // Read and print the server's response
        while (client.available()) {
          char c = client.read();
          Serial.print(c);        
        }
       client.stop();
        Serial.println("Disconnected from server");
      } else {
        Serial.println("Connection failed");
      }

    }
  }
}

Gab Gab

unread,
Dec 3, 2024, 11:41:26 AM12/3/24
to Gqrx SDR
resolved! I will missed ip in allowed hosts.

gab gab
Reply all
Reply to author
Forward
0 new messages