Skip to content

Commit f97bc00

Browse files
authored
Update README.md
1 parent 85f0c07 commit f97bc00

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ The simplest way to get started is to try one of the examples below.
3434
- [Responses from Line-us](#responses-from-line-us)
3535
- [Timing](#timing)
3636
- [Co-ordinate System](#co-ordinate-system)
37+
- [Connecting Line-us to your Wifi using telent](#connecting-line-us-to-your-wifi-using-telnet)
3738
- [CAUTION for firmware 1.0.1 and lower](#caution-for-firmware-101-and-lower)
3839

3940
## Simple Example code to get you started with programming
@@ -115,7 +116,7 @@ Line-us listens on TCP port 1337 and the connection to Line-us can be tested wit
115116
The websockets URL for your Line-us (assuming you're using the default name) is `ws://line-us.local`. Note that it is not a secure (`wss:`) websocket - unfortunately Line-us's tiny brain isn't quite up to running SSL. On connection you will receive the `hello` message and once you've received it you can start to send GCode. A simple way to experiment with the websockets API is to use [Firecamp](https://firecamp.app) - just connect and send one GCode per message.
116117

117118
### Sending Gcode
118-
GCode commands are a command followed by a zero or more parameters separated by white space. Parameters are a single letter followed immediately by the value. The [GCode Specification Document](Documentation/GCodeSpec.md) has details of all of the available GCodes, but a simepl example would be `G01 X1000 Y0 Z1000` to move to point (1000, 0) with the pen up. Where necessary the values can be enclosed in double quotes `"` for example `M587 Smy-ssid P"password with spaces"` if you have spaces in your WiFi password. For TCP Sockets connections GCode commands _**must**_ be terminated by one of, or a combination of `\r`, `\n`, and `\0`. Websockets connections do not require any terminators in the messages.
119+
GCode commands are a command followed by a zero or more parameters separated by white space. Parameters are a single letter followed immediately by the value. The [GCode Specification Document](Documentation/GCodeSpec.md) has details of all of the available GCodes, but a simple example would be `G01 X1000 Y0 Z1000` to move to point (1000, 0) with the pen up. Where necessary the values can be enclosed in double quotes `"` for example `M587 Smy-ssid P"password with spaces"` if you have spaces in your WiFi password. For TCP Sockets connections GCode commands _**must**_ be terminated by one of, or a combination of `\r`, `\n`, and `\0`. Websockets connections do not require any terminators in the messages.
119120

120121
### Responses from Line-us
121122
Each GCode response will result in a response message from Line-us, which will start with either `ok` indicating success, or `error` indicating an error and is followed by zero or more `KEY:value` pairs as described in the [GCode Specification Document](Documentation/GCodeSpec.md). For TCP Sockets the response message is terminated with `\r\n\0`. In firmware < 3.0.0 it was essential that the full response message was read from the socket including the `\0` before the next command was sent. This is no longer the case with firmware 3.0.0 or later although it is still advisable to read the messages. Fow websockets the respnse will be received in a text messsage.
@@ -126,5 +127,10 @@ If a GCode command that moves the arm is sent to Line-us while the arm is still
126127
### Co-ordinate System
127128
Line-us GCode commands use 'machine co-ordinates'. The origin point (0, 0) for the co-ordinate system is at the centre point of the servo shafts, and GCode commands use drawing units (100 drawing units is approximately 5mm). The home point for the arm is (1000, 1000). The z axis is the pen height; 0 is down and 1000 is up. The shape if the drawing area is not rectangular. See the [Line-us Drawing Area Diagram](Documentation/LineUsDrawingArea.pdf) for details. If a GCode for a movement outside of the drawing is sent Line-us will move to something approximating the closest it can get to that point while still remaining within the drawing area and lift the pen.
128129

130+
### Connecting Line-us to your Wifi using telent
131+
Most people will use the Line-us App to connect their Line-us to WiFi, but were's the fun in that! The commands to configure WiFi are GCode commands just like everything else so you're able to connect Line-us to WiFi by connecting to Line-us using telent and issuing the connect command. Firstly, make sure you have a telnet client installed on your computer. Linux will probably come with it already installed, but MacOS and Windows don't. For Windows you can install via the Control Panel/Programs/Turn windows features on and off and then look for Telnet client. On Mac the simplest is via Homebrew. If you have homebrew installed then it's just `brew install telnet`.
132+
133+
Once you have telnet installed then put your Line-us into Setup mode by pressing the button until the light flashes red. Then you can connect your computer to the WiFi network Line-us-Setup. Then you can connect to Line-us using telnet; on Linux and Mac you can connect at the command prompt using `telnet 192.168.4.1 1337`. If you're running the telnet app in Windows it's `open 192.168.4.1 1337`. After a few seconds Line-us will then wave it's arm and you'll see the `hello` message. At this point you can send any GCode command you like (see the Sending GCCode section above), but the command to connect to your WiFi is `M587 Smy-ssid P"my-password"`. Once you've sent the command Line-us will disconect from your computer abd try to connect to your WiFi using the ssid and password used in the command. If it's successful the light will turn to solid blue. If it can't connect for any reason (perhaps an incorrect password) the light will flash red again and you can re-connect your computer and try again (if the light flashes blue then hold the button until it flashes red again). To end the telnet session type `ctrl ]` to get back to the telnet prompt and then type close
134+
129135
### CAUTION for firmware 1.0.1 and lower
130136
It should not be possible to send a GCode that overstretches the arm, or causes it to hit the body of Line-us. However, in firmware 1.0.1 and lower there is an area where the pen screw can come into contact with the body. For y positions < 0 the x coordinate should be limited to x >= 700 by your software as firmware 1.0.1 and lower allow x >= 500 in this zone. This will has now been fixed so please update to the latest firmware.

0 commit comments

Comments
 (0)