{"action":"created","issue":{"url":"https://api.github.com/repos/arkypita/LaserGRBL/issues/515","repository_url":"https://api.github.com/repos/arkypita/LaserGRBL","labels_url":"https://api.github.com/repos/arkypita/LaserGRBL/issues/515/labels{/name}","comments_url":"https://api.github.com/repos/arkypita/LaserGRBL/issues/515/comments","events_url":"https://api.github.com/repos/arkypita/LaserGRBL/issues/515/events","html_url":"https://github.com/arkypita/LaserGRBL/issues/515","id":385466301,"node_id":"MDU6SXNzdWUzODU0NjYzMDE=","number":515,"title":"Wi-fi connection issues","user":{"login":"fabbbio986","id":45404920,"node_id":"MDQ6VXNlcjQ1NDA0OTIw","avatar_url":"https://avatars1.githubusercontent.com/u/45404920?v=4","gravatar_id":"","url":"https://api.github.com/users/fabbbio986","html_url":"https://github.com/fabbbio986","followers_url":"https://api.github.com/users/fabbbio986/followers","following_url":"https://api.github.com/users/fabbbio986/following{/other_user}","gists_url":"https://api.github.com/users/fabbbio986/gists{/gist_id}","starred_url":"https://api.github.com/users/fabbbio986/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabbbio986/subscriptions","organizations_url":"https://api.github.com/users/fabbbio986/orgs","repos_url":"https://api.github.com/users/fabbbio986/repos","events_url":"https://api.github.com/users/fabbbio986/events{/privacy}","received_events_url":"https://api.github.com/users/fabbbio986/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2018-11-28T21:34:09Z","updated_at":"2018-12-17T22:18:21Z","closed_at":null,"author_association":"NONE","body":"Hi everyone!\r\nFirst of all thank you arkypita for sharing your work!\r\nI'm using laserGRBL with my 3D printed laser engraver through USB connection but now I am trying to use it through ESP8266.\r\n\r\nAt the moment I'm trying to use a NodeMCU board (ESP8266 12-e) connected to the arduino UNO that has a CNCshield on it.\r\n\r\nI have to highlight first a problem that I have during the sketch  [websocketserver.ino](https://github.com/arkypita/ESP8266-SerialWebSocket/blob/master/websocketserver/websocketserver.ino) uploading: when the arduino IDE is compiling the sketch, it gives me an error on line 145. The only way that I have found to upload the sketch is to change from _\"const char\"_ to _\"const unsigned char\"_ .\r\nIs that normal?\r\nDo anyone else has experienced the same problem?\r\n\r\nThis is the error message  given:\r\n\r\n> Arduino:1.8.5 (Windows 10), Scheda:\"NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200\"\r\n> \r\n> C:\\Users\\Fabio\\Desktop\\laser\\wifi\\websocketserver\\websocketserver.ino: In function 'void webSocketEvent(uint8_t, WStype_t, uint8_t*, size_t)':\r\n> \r\n> websocketserver:145: error: invalid conversion from 'const char*' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive]\r\n> \r\n>                Serial.write((const char *) (payload), (lenght));\r\n> \r\n>                                                               ^\r\n> \r\n> In file included from C:\\Users\\Fabio\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.2\\cores\\esp8266/Arduino.h:261:0,\r\n> \r\n>                  from C:\\Users\\Fabio\\Desktop\\laser\\wifi\\websocketserver\\websocketserver.ino:3:\r\n> \r\n> C:\\Users\\Fabio\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.2\\cores\\esp8266/HardwareSerial.h:156:12: error:   initializing argument 1 of 'virtual size_t HardwareSerial::write(const uint8_t*, size_t)' [-fpermissive]\r\n> \r\n>      size_t write(const uint8_t *buffer, size_t size)\r\n> \r\n>             ^\r\n> \r\n> exit status 1\r\n> invalid conversion from 'const char*' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive]\r\n> \r\n> Questo report potrebbe essere più ricco di informazioni abilitando l'opzione\r\n> \"Mostra un output dettagliato durante la compilazione\"\r\n> in \"File -> Impostazioni\"\r\n> \r\n\r\nAs I said previously with this little modification I have uploaded the sketch and I successfully connected the nodeMCU board to my wifi network using the web interface.\r\nAfter that I have assigned a static address to the nodeMCU (192.168.1.7) through the router settings.\r\nOnce opened laserGRBL, I switched to LaserWeb8266 mode and put in the field _Socket URL_ the address: **ws://192.168.1.7:81** and clicked on the connect button.\r\n\r\nAt this moment the program gives me the message (on the left window) _Connected_ but the status on the lower right angle is _Connecting_ and after about 10 seconds the status changes to _Disconnected_.\r\n\r\nDuring these 10 seconds I can't send any \"gcode command\" but if I send the _\"WIFIRESET\"_ command it works.\r\n\r\nDoes laserGRBL need a confirmation message (from esp8266 + arduino) during the connection process to establish the connection?\r\nIs that can be caused by a bad connection between nodeMCU and arduino?\r\nShould LaserGRBL connect to nodeMCU even if nothing is connected to the RX and TX pins?\r\n\r\nThank you for your help!"},"comment":{"url":"https://api.github.com/repos/arkypita/LaserGRBL/issues/comments/448020200","html_url":"https://github.com/arkypita/LaserGRBL/issues/515#issuecomment-448020200","issue_url":"https://api.github.com/repos/arkypita/LaserGRBL/issues/515","id":448020200,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODAyMDIwMA==","user":{"login":"fabbbio986","id":45404920,"node_id":"MDQ6VXNlcjQ1NDA0OTIw","avatar_url":"https://avatars1.githubusercontent.com/u/45404920?v=4","gravatar_id":"","url":"https://api.github.com/users/fabbbio986","html_url":"https://github.com/fabbbio986","followers_url":"https://api.github.com/users/fabbbio986/followers","following_url":"https://api.github.com/users/fabbbio986/following{/other_user}","gists_url":"https://api.github.com/users/fabbbio986/gists{/gist_id}","starred_url":"https://api.github.com/users/fabbbio986/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabbbio986/subscriptions","organizations_url":"https://api.github.com/users/fabbbio986/orgs","repos_url":"https://api.github.com/users/fabbbio986/repos","events_url":"https://api.github.com/users/fabbbio986/events{/privacy}","received_events_url":"https://api.github.com/users/fabbbio986/received_events","type":"User","site_admin":false},"created_at":"2018-12-17T22:18:21Z","updated_at":"2018-12-17T22:18:21Z","author_association":"NONE","body":"> Should be simple as sending a string with your gcode followed by \\n\r\n> \r\n> webSocketClient.sendData(\"G0 X10 Y10\\n\");\r\n\r\nThank you! I was missing the \"\\n\"!\r\n\r\n(I have to use the webSocket.sendTXT(\"G0 X10 Y10\\n\"); command instead of webSocketClient.sendData(\"G0 X10 Y10\\n\"); otherwise the IDE gives me an error).\r\n\r\n\r\n\r\n> and then wait for \"ok\" or \"error\" response before send next command\r\n> \r\n> https://github.com/gnea/grbl/wiki/Grbl-v1.1-Interface\r\n\r\nI have written a few line to read the incoming text from the server and compare with a string (\"ok\") as suggested [here](https://github.com/Links2004/arduinoWebSockets/issues/192) but when compiling it gives me an error about the crosses initialization.\r\n\r\n> WebSocketClient:45: error: crosses initialization of 'String payload_str'\r\n\r\n          String payload_str = String((char*) payload);\r\n\r\n.\r\n\r\nThe idea is to check the incoming message from the server and if the message is \"ok\" it gives me the capability to send another command from the client.\r\n\r\n"}}
{"actor":{"display_login":"fabbbio986"}}