"Hello everyone,
I'm currently working on a tutorial titled 'Introduction to FreeMASTER Dashboard Coding Using HTML, JavaScript, ActiveX, and JSON-RPC.' During this project, I encountered an issue when attempting to read variables from my NXP board using the JSON-RPC method. The problem surfaced when I tried to open an HTML file in the Chrome browser, and upon inspecting the developer tools, I received the following error message: (freemaster-client.js):161 WebSocket connection to 'ws://localhost:41000/' failed. Subsequently, my JavaScript code threw an error with a status code of 1006.
I have tried various troubleshooting methods, but I have not been able to resolve the issue. If anyone has insights or suggestions on how to address this WebSocket connection error, I would greatly appreciate your guidance.
Thank you for your help.
解決済! 解決策の投稿を見る。
Hello,
we have not heard about this issue before. I wonder if there could be a firewall which prevents connection to the localhost TCP port.
Very quick test is to run FreeMASTER and run "telnet localhost 41000" in a 'cmd' command line. If you get a connection error, then I would bet someone (firewall) blocks the connection. If telnet connects well, then it will be an issue of Chrome engine and we will need to analyze it further.
Note: in telnet, a successful connection means you will get a blank screen without errors. By typing { } as an empty/invalid JSON-RPC command, you should get a response something like:
{"jsonrpc":"2.0","id":"","error":{"code":-32600,"message":"Unknown error"}}
Regards,
Michal
Hello,
we have not heard about this issue before. I wonder if there could be a firewall which prevents connection to the localhost TCP port.
Very quick test is to run FreeMASTER and run "telnet localhost 41000" in a 'cmd' command line. If you get a connection error, then I would bet someone (firewall) blocks the connection. If telnet connects well, then it will be an issue of Chrome engine and we will need to analyze it further.
Note: in telnet, a successful connection means you will get a blank screen without errors. By typing { } as an empty/invalid JSON-RPC command, you should get a response something like:
{"jsonrpc":"2.0","id":"","error":{"code":-32600,"message":"Unknown error"}}
Regards,
Michal
Hello @MichalH,
We tried running the command 'telnet localhost 41000,' and it resulted in a black screen with the cursor positioned in the top left corner. When we attempted to type '{}', it immediately exited the black screen, preventing us from entering any commands. We initially suspected a firewall issue and even uninstalled the McAfee antivirus software, but the problem persisted.
It's worth noting that the same code and command work on different devices without any issues. As a result, we are currently at a loss and would appreciate any additional hints or troubleshooting suggestions.
Hello,
please make sure that also the built-in Windows firewall is temporarily disabled to rule out that this is the issue.
Another experiment would be to run the FreeMASTER pcmaster.exe process with an argument /rpcs 50000 or a different port number and test it with telnet. Maybe the default 41000 is blocked by another process.
Please let me know the result,
Thanks,
Michal