-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
escape character over ws #45
Comments
I'm not really sure what you're asking? You're saying it works from On Fri, Feb 26, 2016 at 5:49 AM, mzi1sk [email protected] wrote:
|
yes exactly. From localhost it runs perfect. If I try to send it over ws, I get : {"Error" : "Problem decoding json. giving up. json: {"Data":[{"D":"�b ","ID":"100","Pause":100},{"D":"Nazov Pocet Jedn.Cena Dan Suma ","ID":"101","Pause":100},{"D":"Aglio olio e peperoncino ","ID":"102","Pause":100},{"D":" 1 Ks 7.5 �1 7,50 EUR ","ID":"103","Pause":100},{"D":"Pasta salmone zucchine ","ID":"104","Pause":100},{"D":" 1 Ks 11.0 �1 11,00 EUR ","ID":"105","Pause":100},{"D":"Aglio olio e peperoncino ","ID":"106","Pause":100},{"D":" 1 Ks 7.5 �1 7,50 EUR ","ID":"107","Pause":100},{"D":"Pasta salmone zucchine ","ID":"108","Pause":100},{"D":" 1 Ks 11.0 �1 11,00 EUR ","ID":"109","Pause":100},{"D":"Linguine frutti di mare ","ID":"110","Pause":100},{"D":" 1 Ks 11.0 �1 11,00 EUR ","ID":"111","Pause":100},{"D":"�k 48,00 ","ID":"112","Pause":100},{"D":"�P1 48,00 EUR ","ID":"113","Pause":100},{"D":"�e ","ID":"114","Pause":100}],"P":"COM3"} , err:invalid character '\x1b' in string literal"} |
This forum is for bugs, not to help you figure out how to write code. On Fri, Feb 26, 2016 at 8:12 AM, mzi1sk [email protected] wrote:
|
ok isnt it an issue? Anyway is there any other forum to the project ? Maybe you can consider to set one, as that would really help to avoid your waste of time with us not smart enough to get over some probably stupid mistakes. |
localhost?:8989 is over Websockets. so if it works there, it works over Websockets. so this is your code. |
There's no forum but feel free to set one up.
|
If I send this command to json server using websocket I am getting error : err:invalid character '\x1b' in string literal. If I send command using localhost:8989 it works. As for my device is escape character(\x1b ) a must symbol any idea what I do wrong is appreciated.
sendjson {"Data":[{"D":"\u001bb\r\n","ID":"100","Pause":100},{"D":"Nazov Pocet Jedn.Cena Dan Suma \r\n","ID":"101","Pause":100},{"D":"Aglio olio e peperoncino \r\n","ID":"102","Pause":100},{"D":" 1 Ks 7.5 \u001b1 7,50 EUR \r\n","ID":"103","Pause":100},{"D":"Pasta salmone zucchine \r\n","ID":"104","Pause":100},{"D":" 1 Ks 11.0 \u001b1 11,00 EUR \r\n","ID":"105","Pause":100},{"D":"Aglio olio e peperoncino \r\n","ID":"106","Pause":100},{"D":" 1 Ks 7.5 \u001b1 7,50 EUR \r\n","ID":"107","Pause":100},{"D":"Pasta salmone zucchine \r\n","ID":"108","Pause":100},{"D":" 1 Ks 11.0 \u001b1 11,00 EUR \r\n","ID":"109","Pause":100},{"D":"Linguine frutti di mare \r\n","ID":"110","Pause":100},{"D":" 1 Ks 11.0 \u001b1 11,00 EUR \r\n","ID":"111","Pause":100},{"D":"\u001bk 48,00 \r\n","ID":"112","Pause":100},{"D":"\u001bP1 48,00 EUR \r\n","ID":"113","Pause":100},{"D":"\u001be \r\n","ID":"114","Pause":100}],"P":"COM3"}
and here is my simple websocket.js
function senddocument( message) {
timeoutID = window.setTimeout(senddocument2ws, 200,message);
}
function senddocument2ws( message) {
window.socket.send(message);
}
function opensocket(address) {
window.socket = new WebSocket(address);
window.socket.onopen = function() {
console.log('open');
}
window.socket.onerror=window.socket.onclose = function (errorEvent) {
alert("Spojenie s fiskalnou pokladnou je uzavrete!!");
}
}
function closesocket() {
}
Thank you
Michal
The text was updated successfully, but these errors were encountered: