Closed ajcyeh closed 4 months ago
Hey ajcyeh,
I’m not sure I can be of any help, I don’t have this router anymore and this project feels like distant memory now.
Perhaps the firmware changed significantly? I have no idea.
You got a timeout error. Can you at least get the html from the web ui if you run a curl command from the pi zero?
Best regards,
On Fri 26 Jul 2024 at 06:33, Andy Yeh @.***> wrote:
Hi plewin,
I am so glad to find out this project. However, after installing nodejs, yarn and yarn install this project, I tested the sms-send.js and after some minutes waiting, I got some error message as below:
Error: connect ETIMEDOUT 192.168.1.1:80 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1607:16) { errno: -110, code: 'ETIMEDOUT', syscall: 'connect', address: '192.168.1.1', port: 80, config: { url: 'http://192.168.1.1/cgi/getParm', method: 'post', data: null, headers: { Accept: 'application/json, text/plain, /', 'Content-Type': 'application/x-www-form-urlencoded', Referer: 'http://192.168.1.1', 'User-Agent': 'axios/0.21.1' }, transformRequest: [ [Function (anonymous)] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, adapter: [Function: httpAdapter], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, validateStatus: [Function: validateStatus], 'axios-retry': { retries: 3, retryCondition: [Function: isRetryableError], retryCount: 3, lastRequestTime: 1721966892604 } }, request: <ref *1> Writable { _events: { close: undefined, error: [Function: handleRequestError], prefinish: undefined, finish: undefined, drain: undefined, response: [Function: handleResponse] }, _writableState: WritableState { highWaterMark: 16384, length: 0, corked: 0, onwrite: [Function: bound onwrite], writelen: 0, bufferedIndex: 0, pendingcb: 0,
}, _maxListeners: undefined, _options: { maxRedirects: 21, maxBodyLength: 10485760, protocol: 'http:', path: '/cgi/getParm', method: 'POST', headers: [Object], agent: undefined, agents: [Object], auth: undefined, hostname: '192.168.1.1', port: null, nativeProtocols: [Object], pathname: '/cgi/getParm' }, _ended: true, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 0, _requestBodyBuffers: [], _eventsCount: 2, _onNativeResponse: [Function (anonymous)], _currentRequest: ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: false, chunkedEncoding: false, shouldKeepAlive: true, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: [Socket], _header: 'POST /cgi/getParm HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'Content-Type: application/x-www-form-urlencoded\r\n' + 'Referer: http://192.168.1.1\r\n' + 'User-Agent: axios/0.21.1\r\n' + 'Host: 192.168.1.1\r\n' + 'Connection: keep-alive\r\n' + 'Content-Length: 0\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'POST', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/cgi/getParm', _ended: false, res: null, aborted: false, timeoutCb: [Function: emitRequestTimeout], upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: '192.168.1.1', protocol: 'http:', _redirectable: [Circular *1],
[Symbol(kOutHeaders)]: [Object: null prototype],
}, _currentUrl: 'http://192.168.1.1/cgi/getParm',
}, response: undefined, isAxiosError: true, toJSON: [Function: toJSON] }
I installed in PI Zero 2 W, which runs in the MR600 local network. MR600 is V2 with lastest firmware. I can login through its web interface at http:192.168.1.1 with a password only (no "admin"), and can send/receive SMS in this web interface. I tested both sms-send.js command line and with config file, but both did not work.
Are you able to assist with debugging?
Best regards,
ajcyeh
— Reply to this email directly, view it on GitHub https://github.com/plewin/tp-link-modem-router/issues/31, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFMVLMUKXUOOEY4JCYMIXDZOHGQ5AVCNFSM6AAAAABLPYZUKKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQZTCNBQGMZDCOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Hi plewin,
Thanks for the quick reply. I did "curl 192.168.1.1" from pi zero 2 w and got
curl: (28) Failed to connect to 192.168.1.1 port 80 after 133798 ms: Couldn't connect to server
Are there particular headers needed to get a response? I can use Chrome to get to its web ui, and with this MR600 V2, the login page requires only a password, no user name admin (see attached screenshot). Can you still remember whether it was the same or the firmware and web ui have since changes a lot from the time you did this project?
Best,
ajcyeh
Hi plewin,
I found the potential issue may be my pi zero is connected to the guest wifi and hence it cannot reach 192.168.1.1. After changing to its wireless network (not guest wifi), I can now get response from 192.168.1.1 using curl. The guest wifi has options to access local network and each other but even enabled, access to the router is still not allowed. Perhaps this is its security mechanism.
I tried the sms-send.js again, and it responds with "Great! SMS send operation was accepted." but because the sim card is not in it (I can only have it at my work place) so will try again on Monday. And I think it is looking good, will let you know if it works.
Many thanks.
ajcyeh
I can't resist to test in office today and it works well. Thank you plewin for this great project. :-)
Hi plewin,
I am so glad to find out this project. However, after installing nodejs, yarn and yarn install this project, I tested the sms-send.js and after some minutes waiting, I got some error message as below:
Error: connect ETIMEDOUT 192.168.1.1:80 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1607:16) { errno: -110, code: 'ETIMEDOUT', syscall: 'connect', address: '192.168.1.1', port: 80, config: { url: 'http://192.168.1.1/cgi/getParm', method: 'post', data: null, headers: { Accept: 'application/json, text/plain, /', 'Content-Type': 'application/x-www-form-urlencoded', Referer: 'http://192.168.1.1', 'User-Agent': 'axios/0.21.1' }, transformRequest: [ [Function (anonymous)] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, adapter: [Function: httpAdapter], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, validateStatus: [Function: validateStatus], 'axios-retry': { retries: 3, retryCondition: [Function: isRetryableError], retryCount: 3, lastRequestTime: 1721966892604 } }, request: <ref *1> Writable { _events: { close: undefined, error: [Function: handleRequestError], prefinish: undefined, finish: undefined, drain: undefined, response: [Function: handleResponse] }, _writableState: WritableState { highWaterMark: 16384, length: 0, corked: 0, onwrite: [Function: bound onwrite], writelen: 0, bufferedIndex: 0, pendingcb: 0,
}, response: undefined, isAxiosError: true, toJSON: [Function: toJSON] }
I installed in PI Zero 2 W, which runs in the MR600 local network. MR600 is V2 with lastest firmware. I can login through its web interface at http:192.168.1.1 with a password only (no "admin"), and can send/receive SMS in this web interface. I tested both sms-send.js command line and with config file, but both did not work.
Are you able to assist with debugging?
Best regards,
ajcyeh