Message Boards Message Boards

Connect a i2c to a Raspberry Pi 3?

Posted 7 years ago

hello everyone. I just started playing with Mathematica on my raspberry pi 3 the other day after finding out that we can access serial, gpio, and i2c connections. unfortunately, while i2cdetect -y 1 will correctly show that I have an i2c device at the address 0x03 on bus 1, and a python script will successfully read data from the sensor, Mathematica will only return an empty list after executing FindDevices["I2C"]. I should mention that at first FindDevices[] was giving me some issues with libload but it was resolved by upgrading MRAALink to 1.0.5., and now FindDevices[] (without specifying anything) will return:

Wolfram Language 11.0.1 Engine for Linux ARM (32-bit)
Copyright 1988-2017 Wolfram Research, Inc.

In[1]:= FindDevices[]

DeviceOpen::cameraDisabled: The camera is disabled.  Please enable it via raspi-config.

Out[1]= {DeviceObject[{FunctionDemo, 1}], DeviceObject[{GPIO, 1}], DeviceObject[{RandomSignalDemo, 1}], DeviceObject[{WriteDemo, 1}]}

does anyone have some insight as to what my next step should be?

in the short term I can simply import the data output from the python script but if possible I would like to do everything from within mathematica. also if it helps at all mathematica can successfully interact with my arduino, so serial definitely works. any help would be appreciated, thank you for at least taking the time to read all of this.

POSTED BY: Matthew Kovacs
4 Replies
Posted 7 years ago

so a quick update: I received my sensehat in the mail today and after connecting it to my pi mathematica picked it up immediately with no problems, so clearly i2c is working in mathematica. when I get a couple parts (no idea when) I'll try connecting my other sensor to the pi+sensehat and see what happens.

POSTED BY: Matthew Kovacs

I had to run 'modprobe i2c-bcm2708' to get a SenseHAT detected, although a module with name 'i2c_bcm2835' was already loaded.

Best regards Michael

Hi,

Have you followed the setup steps described at http://reference.wolfram.com/language/tutorial/I2CSetup.html ?

If you have, can you post what the output of running this in a terminal session is:

cat /proc/cpuinfo

Thanks,

Ian

POSTED BY: Ian Johnson
Posted 7 years ago
POSTED BY: Matthew Kovacs
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