{"action":"created","issue":{"url":"https://api.github.com/repos/openhardwarecoza/LaserWeb3/issues/3","repository_url":"https://api.github.com/repos/openhardwarecoza/LaserWeb3","labels_url":"https://api.github.com/repos/openhardwarecoza/LaserWeb3/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/openhardwarecoza/LaserWeb3/issues/3/comments","events_url":"https://api.github.com/repos/openhardwarecoza/LaserWeb3/issues/3/events","html_url":"https://github.com/openhardwarecoza/LaserWeb3/issues/3","id":158194246,"number":3,"title":"Best Practise: Grbl Buffer","user":{"login":"openhardwarecoza","id":7695323,"avatar_url":"https://avatars.githubusercontent.com/u/7695323?v=3","gravatar_id":"","url":"https://api.github.com/users/openhardwarecoza","html_url":"https://github.com/openhardwarecoza","followers_url":"https://api.github.com/users/openhardwarecoza/followers","following_url":"https://api.github.com/users/openhardwarecoza/following{/other_user}","gists_url":"https://api.github.com/users/openhardwarecoza/gists{/gist_id}","starred_url":"https://api.github.com/users/openhardwarecoza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openhardwarecoza/subscriptions","organizations_url":"https://api.github.com/users/openhardwarecoza/orgs","repos_url":"https://api.github.com/users/openhardwarecoza/repos","events_url":"https://api.github.com/users/openhardwarecoza/events{/privacy}","received_events_url":"https://api.github.com/users/openhardwarecoza/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-06-02T17:19:01Z","updated_at":"2016-06-02T18:00:49Z","closed_at":null,"body":"@chamnit \r\n\r\nRight, if I need to write a whole new buffer for SPJS (refer the fight in issue 52 on openhardwarecoza/LaserWeb2), i'd rather start over fresh (In nodejs, where i am comfortable, and without the few hundred thousand lines of SPJS code to confuse me)\r\n\r\nSo, what I built here: https://github.com/openhardwarecoza/LaserWeb3/blob/master/server.js\r\nnode-serialport: Connect to a serial endpoint. Keeping it VERY simple to start off...\r\n\r\nI have an array called gcodeQueue\r\n\r\nTo this queue I can prepend data (to push a request for position feedback into the queue in front) or append to the back - with respectively\r\n\r\nhttps://github.com/openhardwarecoza/LaserWeb3/blob/master/server.js#L162- jumpQ (puts it in front)\r\nhttps://github.com/openhardwarecoza/LaserWeb3/blob/master/server.js#L158 - addQ (adds it last)\r\n\r\nNext I can take entries from this array, by shifting them out into a var https://github.com/openhardwarecoza/LaserWeb3/blob/master/server.js#L170-L177 and writing it to the serial port.\r\n\r\nthe send1Q function only sends one LINE of gcode.\r\n\r\nIt gets called after a 50ms delay after an OK (so simple ping pong buffer) - I also manually call it after adding a M114 to the queue: https://github.com/openhardwarecoza/LaserWeb3/blob/master/server.js#L114-L115\r\n\r\nNow, theoretically, for marlin, that should result in a send, ok, send, ok.\r\n\r\nCan you advise me, what is the best way to get this done to Grbl?\r\nWe never could get it working nicely in Laserweb v 1  -  https://github.com/openhardwarecoza/LaserWeb/issues/94\r\n\r\nIn LaserWeb v2 it works, but depends on Serial Port JSON server (and I'm tired of being told of TinyG's superiority - so i'm moving on) \r\n\r\nAppreciate any help, lets hope 3rd times the charm and we get Grbl + laserWeb playing really nicely under node-serialport!\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/openhardwarecoza/LaserWeb3/issues/comments/223372004","html_url":"https://github.com/openhardwarecoza/LaserWeb3/issues/3#issuecomment-223372004","issue_url":"https://api.github.com/repos/openhardwarecoza/LaserWeb3/issues/3","id":223372004,"user":{"login":"chamnit","id":948029,"avatar_url":"https://avatars.githubusercontent.com/u/948029?v=3","gravatar_id":"","url":"https://api.github.com/users/chamnit","html_url":"https://github.com/chamnit","followers_url":"https://api.github.com/users/chamnit/followers","following_url":"https://api.github.com/users/chamnit/following{/other_user}","gists_url":"https://api.github.com/users/chamnit/gists{/gist_id}","starred_url":"https://api.github.com/users/chamnit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chamnit/subscriptions","organizations_url":"https://api.github.com/users/chamnit/orgs","repos_url":"https://api.github.com/users/chamnit/repos","events_url":"https://api.github.com/users/chamnit/events{/privacy}","received_events_url":"https://api.github.com/users/chamnit/received_events","type":"User","site_admin":false},"created_at":"2016-06-02T18:00:49Z","updated_at":"2016-06-02T18:00:49Z","body":"@openhardwarecoza : That's strange. Can you describe what kind of lost characters you experienced and under what circumstances? I do know that Inventables' Easel uses NodeJS for their streamer. They haven't reported any issues to me about the serial stream becoming unstable. \r\n\r\nI do know that Go lang has a garbage collection routine that would kill a serial stream while it runs and return to normal operation. It's uncontrolled and occurs frequently. In my tests with Chilipepper and SPJS, you can hear audible hiccups in the machine when the GC kicks in. Not sure if Node has something similar issue."}}
{"actor":{"display_login":"chamnit"}}