These are chat archives for nebrius/raspi-io

10th
Feb 2016
sebbalex
@sebbalex
Feb 10 2016 22:01
hello guys
is there someone online right now?
Bryan Hughes
@nebrius
Feb 10 2016 22:09
Hi @sebbalex, what’s up?
sebbalex
@sebbalex
Feb 10 2016 22:13
hey, how's going
anyway, obviously, Im here to ask some support
Bryan Hughes
@nebrius
Feb 10 2016 22:13
life is good :)
ask away!
sebbalex
@sebbalex
Feb 10 2016 22:14
you've made a great job with your raspi-io
:)
the integration with johnny-five it's awesome
but I need to know something to speed up my develpment
there is a way to mock the library?
a way to emulate the raspberry behaviour?
Bryan Hughes
@nebrius
Feb 10 2016 22:15
hmm…kinda, sorta
sebbalex
@sebbalex
Feb 10 2016 22:16
I cant even install the library on my local environment
(osx)
Bryan Hughes
@nebrius
Feb 10 2016 22:16
Johnny-five has an IO plugin built-in called “mock firmata.” I’m not sure how easy it is to use normally (it’s used in tests), but it mocks out an Arduino
It’s not exactly the same as the Raspberry Pi, because the port numbers are different, but other than that should be the same
sebbalex
@sebbalex
Feb 10 2016 22:16
umh
great
need to try
Bryan Hughes
@nebrius
Feb 10 2016 22:17
you could architect your code so that port numbers are read from, say, a JSON file, e.g.
{
  “leftServo”: “PWM1”
}
and then you can swap between a mock-firmata capable one and a raspi-io capable one
Rick Waldron
@rwaldron
Feb 10 2016 22:18
@sebbalex if you install bash on th RPi, you can install rmate/rsub/ratom, which lets you open files from the device “remotely” in your local editor
you just ssh to the board on the specified port
sebbalex
@sebbalex
Feb 10 2016 22:18
ah
awesome
both solutions are great
Rick Waldron
@rwaldron
Feb 10 2016 22:19
and then run eg. ratom file.js and it will open in your local atom editor (rsub=sublime, rmate=textmate, ratom=atom editor)
all it really does is create a tmp file locally and coordinates an scp
but it makes a huge difference
Bryan Hughes
@nebrius
Feb 10 2016 22:20
yep, that’s a great solution too! That’s what I do if I have an RPi available
sebbalex
@sebbalex
Feb 10 2016 22:21
of course it assume to have a rpi always reachable
would be cool to create a docker container or a simple vm that just emulate a rpi