Node.js bindings for Bus Pirate
The code is fairly untested, and may break your kit. However, these modes have been mostly implemented, and partially tested:
- UART (Read/Write/Bridge)
- SPI (Sniff/Write-read)
node-buspirate is in the npm registry!
npm install node-buspirate
Or you could always clone / fork this repo:
git clone https://github.com/rmhsilva/node-buspirate.git cd node-buspirate && npm install
Check the examples folder for examples of how it can be used.
#!/usr/bin/env nodevar BusPirate = require'./node-buspirate';var pirate = '/dev/bus_pirate';pirateon'connected'pirateuartstartbaudrate: 115200stop_bits: 1data_bits: 8 // ... and other options;;pirateuarton'ready'pirateconfig_periphtruetruetruetrue;pirateuartecho_rxtrue;setIntervalpirateuartwrite'ping UART\r\n';3000;;pirateuarton'data'processstdoutwritedata;;
The plan is to add other Bus Pirate modes (I2C...) which will be used similarly.
The BusPirate object is an eventEmitter built on top of a node Serialport. It gets the hardware into raw bitbang mode, then just sends and receives raw data from the hardware, and lets other modules handle the specifics of each mode.
- Write modules to handle other BusPirate modes.
- And much more...