Skip to content
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

Support brushless servo upgrade #162

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f21920b
Ignore package-lock.json
alexrudd2 Jul 8, 2023
314bf32
Configure Renovate
renovate[bot] Jun 27, 2023
ee970e2
Run actions on origin-main
alexrudd2 Jun 28, 2023
d52ccbc
chore(deps): update dependency gh-pages to v5 (#34)
renovate[bot] Jun 27, 2023
9594f01
fix(deps): update dependency flatten-svg to ^0.3.0 (#4)
renovate[bot] Jun 27, 2023
f843320
fix(deps): update dependency svgdom to v0.1.14 (#27)
renovate[bot] Jun 27, 2023
f812b62
fix(deps): update dependency yargs to v17 (#47)
renovate[bot] Jun 30, 2023
fdb7be0
Revert "Ignore package-lock.json"
alexrudd2 Jul 8, 2023
05519e2
chore(deps): update typescript-eslint monorepo to v6
renovate[bot] Jul 10, 2023
7a52d3b
run actions on brushless
alexrudd2 Aug 18, 2023
bce31bb
Drop Node 14 (#81)
alexrudd2 Aug 30, 2023
86ebb2f
chore(deps): update dependency gh-pages to v6 (#78)
renovate[bot] Aug 30, 2023
6beb946
chore(deps): update dependency typescript to ~5.0 || ~5.2.0 (#70)
renovate[bot] Aug 30, 2023
c5b1f7b
chore(deps): update dependency @types/ws to 8.0.0 - 8.5 (#69)
renovate[bot] Aug 30, 2023
1d158ee
chore(deps): update actions/checkout action to v4
renovate[bot] Sep 4, 2023
a116669
Describe rpi 0/1 install process (#85)
jedahan Sep 8, 2023
3731448
Migrate from webpack to esbuild (#84)
jedahan Sep 8, 2023
18905d8
Call port.open() before querying it (#77)
alexrudd2 Sep 8, 2023
4123dff
fix(deps): update dependency svgdom to v0.1.16 (#82)
renovate[bot] Sep 8, 2023
0d08150
Break out Device into AxidrawBrushless
alexrudd2 Jul 8, 2023
fbb077e
Create a profile for AxiDrawBrushlessFast
alexrudd2 Jul 8, 2023
959d50d
Add brushless config to EBB
alexrudd2 Jul 8, 2023
990bcac
Use profile penUp instead of hardcoded values. Closes #178
alexrudd2 Aug 17, 2023
a2ee760
Add brushless to server
alexrudd2 Aug 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Node.js CI

on:
push:
branches: [ "main" ]
branches: [ "main", "origin-main", "brushless" ]
pull_request:
branches: [ "main" ]
branches: [ "main", "origin-main", "brushless" ]

jobs:
build:
Expand All @@ -16,11 +16,11 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
node-version: [16.x, 18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,22 @@ Connecting to EBB on /dev/tty.usbmodem1461
If you encounter an `EACCES` error when installing the package globally, see [Resolving EACCES permissions errors when installing packages globally](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally).

#### Raspberry Pi
To install saxi on a Raspberry Pi, first install node.js if you haven't already:

To install saxi on a Raspberry Pi 2/3/4, first install node.js if you haven't already:

```
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
$ sudo apt-get install -y nodejs
```

If you are on a raspberry pi zero or 1, you will need to download an [unofficial armv6l build](https://github.com/nodejs/unofficial-builds)

```
$ wget https://unofficial-builds.nodejs.org/download/release/v20.5.1/node-v20.5.1-linux-armv6l.tar.xz
$ tar xf node-v*-armv6l.tar.xz
$ export PATH=$PATH:$PWD/node-v*-linux-armv6l/
```

and then proceed as above :) If you connect to the raspberry pi over ssh, you might want to run the `saxi` server inside a tmux or screen session to have it stay running even if your ssh session disconnects.

#### CORS
Expand Down
51 changes: 51 additions & 0 deletions build.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { context, build } from 'esbuild';
import inlineWorker from 'esbuild-plugin-inline-worker';
import { htmlPlugin as html } from '@craftamap/esbuild-plugin-html';

const buildOptions = {
entryPoints: ['src/ui.tsx'],
bundle: true,
platform: 'browser',
target: 'es2020',
sourcemap: true,
metafile: true,
logLevel: 'debug',
outdir: 'dist/ui',
tsconfig: 'tsconfig.web.json',
loader: { '.svg': 'file' },
define: {
IS_WEB: process.env.IS_WEB ?? '0',
},
plugins: [ inlineWorker(),
html({
files: [{
entryPoints: [ 'src/ui.tsx'],
filename: 'index.html',
htmlTemplate: 'src/index.html',
scriptLoading: 'defer',
}]
})
],
resolveExtensions: ['.js', '.ts', '.tsx', '.svg', '.worker.js'],
};

(async () => {
try {
if (process.env.BUILD_MODE === 'development') {
// enables live-reloading
const ctx = await context({
...buildOptions,
banner: { js: "new EventSource('/esbuild').addEventListener('change', () => location.reload());" }
})
await ctx.watch();
const { host, port } = await ctx.serve({servedir: 'dist/ui', port: 9080 });
console.log(`http://${host}:${port}`)
} else {
await build(buildOptions);
}
} catch (error) {
console.error(error);
process.exit(1);
}
})();

Loading