Message Boards Message Boards

0
|
9210 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Writing to GPIO from remote notebook

I've noticed that the 
DeviceConfigure["GPIO", 4 -> "Output"]
DeviceWrite["GPIO",4 -> 1]
does nothing being executed from the remote kernel of Mathematica.
When I write just
DeviceWrite["GPIO",4 -> 1]
from the command line, it works and the LED on GPIO4 pin turns on.

It's also interesting that the
DeviceConfigure["GPIO", 4 -> "Input"]
DeviceRead["GPIO",4]
works fine from the remote kernel and reads the real logical state of the pin.
You can even set "1" at GPIO4 from the console and read this "1" from the remote kernel (the fact that the pin has been configured as input from the remote kernel ignores at the console).
--- UPD ---
I've just executed 
DeviceConfigure["GPIO", 4 -> "Input"]
from the console and it worked for the remote kernel (I can't write at GPIO4 anymore). Then I did
DeviceConfigure["GPIO", 4 -> "Output"]
DeviceWrite["GPIO",4 -> 1]
again from the remote notebook and the LED turned on!!! 
I really don't understand how everything started to work, but it works now.
Maybe DeviceConfigure[] works unstable being executed from the remote.
POSTED BY: Himura Kazuto
2 Replies
No. Can I do it by editing the corresponding option in EvaluatorNames using Option Inspector? 
I guess I should treat Kernel Program string by sudo header. Raspberrian doesn't ask password for sudo from "pi" account as I remember
--- upd ---
It can be done by putting root as a user in Kernel Configuration Options
POSTED BY: Himura Kazuto
Was the remote kernel being run as root or with "sudo"?
POSTED BY: Alex Newman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract