I am trying to connect to a FTP server using a passive connection. It worked fine in 0.6.4, but now fails in 0.7.0.
The issue appears when trying to set up the second (data) connection to the FTP server. The Particle firmware doesn’t even send out a packet, it just returns immediately without connecting.
Using the code below with 0.7.0 the second connection fails - we have servers running on port 21 and 65001 so both connections should work.
TCPClient conn1;
TCPClient conn2;
conn1.connect(ahostname, 21);
if (conn1.connected())
CSTR_LOG(LOG_ERROR, "Conn1 Connected")
else
CSTR_LOG(LOG_ERROR, "Conn1 not Connected");
conn2.connect(ahostname, 65001);
if (conn2.connected()) // <--- connection fails
CSTR_LOG(LOG_ERROR, "Conn2 Connected")
else
CSTR_LOG(LOG_ERROR, "Conn2 not Connected");
Stopping the first conn1 before opening conn2 allows conn2 to connect.
TCPClient conn1;
TCPClient conn2;
conn1.connect(ahostname, 21);
if (conn1.connected())
CSTR_LOG(LOG_ERROR, "Conn1 Connected")
else
CSTR_LOG(LOG_ERROR, "Conn1 not Connected");
conn1.stop(); // <-- Add this line and conn2 connects
conn2.connect(ahostname, 65001);
if (conn2.connected())
CSTR_LOG(LOG_ERROR, "Conn2 Connected")
else
CSTR_LOG(LOG_ERROR, "Conn2 not Connected");
I haven’t found a workaround and we really need the FTP functionality ASAP. If you find a solution I would very much appreciate you posting it here.