https://github.com/clvLabs/BusPirate
Seems like a good idea, but doesn’t seem to work too well with BP6.
Has anyone updated it?
https://github.com/clvLabs/BusPirate
Seems like a good idea, but doesn’t seem to work too well with BP6.
Has anyone updated it?
I believe that is for the old version 3.x Bus Pirate.
There are a couple options for scripting 5+. You can copy a similar style script with one command per line to the internal storage and run it with the script command. I will admit this is still dodgy in some areas (menu prompts can’t be auto filled).
If you just want a simple option to replay commands by Python I actually have just the thing. I use a script like this to do terminal output for the documentation. I can add some documentation and add it to its own repo.
Yes, it was developed for v3.6 Bus Pirate.
Their provided sample scripts I tried work flawlessly with the v3.6 BP.
Since I don’t know Python, if the problem isn’t in outdated command syntax I’m sunk.
For interfacing a PC to a 0-5V analog output for valve control, the v3.6 would probably work fine.
The missing part is a way to script the commands to the valve voltage.
Using a BP6 and storing the i2c output control sequence as a macro sounds attractive, but still needs a PC scripting method to invoke the macro.
I’d be interested in seeing your scripting tool.
This might be an easy fun project for tomorrow. I’ll let you know when it’s available.
How badly do you need the output verification? That’s why the old one doesn’t work, it depends on some really old text in the browser.
We’d want at least enough of the response to see if it throws an error, if that’s what you’re asking.
What kind of error specifically?
whatever the interpreter would throw during initial script construction, like these two:
I2C>[0x21 0zx0 0x0]
Warning: *Short or no pull-up
I2C START BIT
WRITE: 0x21 ACK
WRITE: 0x00 ACK
Syntax error at char 8
Here is a fork of clvLabs’ Bus Pirate automation tool for 5+.
There were a couple issue with the old script, but none where what I suspected. For example I thought the old script actually caught and handled error messages, instead it just displays/logs everything.
Text below is from the forked git.
c
command to show the configuration menu, then disable the VT100/ANSI color mode and the status toolbar. This can be done as part of your script.rm bp<mode>.bp
. For example rm bpi2c.bp
to delete the I2C mode configuration file.c // show configuration menu
2 // ANSI color mode setting
1 // disable ANSI color mode
x // exit configuration menu
rm bpi2c.bp // remove configuration file
m i2c // set I2C mode
400 // set I2C speed (400KHz)
1 // disable clock stretching
W 3.3 // start power supplies
P // enable pull-ups
v // read pin states
> D:10 // delay
w // stop power supplies
v // read pin states
m hiz // set HiZ mode
Wow - that’s great.
May not be quite there yet.
Looks like the rm command is going to the ANSI configuration interpreter.
Using the 070b051 firmware.
/// disable ANSI color mode
1
<<< 1
<<< ANSI color mode set to Disable
<<<
<<< Configuration options
<<< 1. Language / Jezik / Lingua / 语言
<<< 2. ANSI color mode
<<< 3. ANSI toolbar mode
<<< 4. LCD screensaver
<<< 5. LED effect
<<< 6. LED color
<<< 7. LED brightness
<<< x. Exit
<<< >
/// remove configuration file so we don’t get stuck at the previous settings prompt
rm bpi2c.bp
<<< rm bpi2c.bp
<<< Error: Invalid option
<<< Configuration options
<<< 1. Language / Jezik / Lingua / 语言
<<< 2. ANSI color mode
<<< 3. ANSI toolbar mode
<<< 4. LCD screensaver
<<< 5. LED effect
<<< 6. LED color
<<< 7. LED brightness
<<< x. Exit
<<< >
/// set I2C mode
m i2c
<<< m i2c
<<< Error: Invalid option
<<< Configuration options
<<< 1. Language / Jezik / Lingua / 语言
<<< 2. ANSI color mode
<<< 3. ANSI toolbar mode
<<< 4. LCD screensaver
<<< 5. LED effect
<<< 6. LED color
<<< 7. LED brightness
<<< x. Exit
<<< >
/// set I2C speed (400KHz)
400
<<< 400
<<< Error: Invalid option
<<< Configuration options
<<< 1. Language / Jezik / Lingua / 语言
<<< 2. ANSI color mode
<<< 3. ANSI toolbar mode
<<< 4. LCD screensaver
<<< 5. LED effect
<<< 6. LED color
<<< 7. LED brightness
<<< x. Exit
<<< >
Looks like all it needed was to add an x command before the rm command in sample.txt.
/// disable ANSI color mode
1
<<< 1
<<< ANSI color mode set to Disable
<<<
<<< Configuration options
<<< 1. Language / Jezik / Lingua / 语言
<<< 2. ANSI color mode
<<< 3. ANSI toolbar mode
<<< 4. LCD screensaver
<<< 5. LED effect
<<< 6. LED color
<<< 7. LED brightness
<<< x. Exit
<<< >
x
<<< x
<<<
<<< Configuration file: Saved
<<<
<<< HiZ>
/// remove configuration file so we don’t get stuck at the previous settings prompt
rm bpi2c.bp
<<< rm bpi2c.bp
<<<
<<< HiZ>
/// set I2C mode
m i2c
<<< m i2c
<<<
<<< Mode: I2C
<<< I2C speed
Thank you, I pushed an update to the docs and the sample.