Re: [beagleboard] Cross Toolchain for QTE 4.8 on Angstrom

2017-06-17 Thread evilwulfie
If it's an option upgrade to debian.

Angstrom is DOA

On 6/17/2017 6:13 PM, 'LV LV' via BeagleBoard wrote:
> Hello,
>
> I am looking for the Angstrom cross toolchain for QT Enbedded 4.8.0
> development.
> It looks like the Angstrom-distribution site is not maintained anymore.
> I looked into the Git repo
> at https://github.com/Angstrom-distribution/buildhistory but I don't
> find what I am looking for.
>
> The file I am looking for should look something like that: 
>
> angstrom--xx-i686-linux-gnueabi-toolchain-qte-4.8.0.tar.bz2
>
> Where -xx represents year-month.
>
> I need that to pick back up on a project that was left on the shelf
> for far too long and unfortunately the machine I was using for cross
> compiling has since then died so I need to setup the tool-chain on a
> new development machine.
>
> Thank you.
>
>
> -- 
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google
> Groups "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to beagleboard+unsubscr...@googlegroups.com
> .
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beagleboard/f379d92c-5e5d-43c0-ae9d-bd6dd7d35261%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/20c268ca-4e0f-5c11-2c67-5d671c7b0cd1%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] What is the best free solution to develop a GUI application on a BB with LCD3 cape as of 2017?

2017-06-17 Thread William Hermans
I suppose it would be useful if I actually shared the link I was tlaking
about. heh https://www.youtube.com/watch?v=aMUh9DmFLto

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORqLHVx0Gws1zvx8u2AGpCZAxAg5AP0wcgGtXTSy-DVr7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] I2C with Debian 8.7 and universal cape?

2017-06-17 Thread Robert Nelson
On Sat, Jun 17, 2017 at 11:51 PM, mark whitney  wrote:
> Hello,
>
> I'm trying to work through the I2C examples in the Molloy book.  But I'm
> using a Honeywell HMC6352 compass since I had one lying around.  It can work
> from 2.7V to 5V and operates at a bus frequency of 100KHz.  I verified that
> it works by hooking it up to a 5V microcontroller.  I can query its
> registers.  But I haven't had any luck communicating with it on a BeagleBone
> Black.
>
> I'm using 3.9V pull-up resistors for SDA and SCL.  Here is info about my
> kernel version, cape slots, and the I2C pins:
>
> debian@beaglebone:~$ uname -a
> Linux beaglebone 4.4.54-bone16 #1 Fri Mar 17 04:56:31 UTC 2017 armv7l
> GNU/Linux
> debian@beaglebone:~$ sudo cat $SLOTS
>  0: PF  -1
>  1: PF  -1
>  2: PF  -1
>  3: PF  -1
>  4: P-O-L-   0 Override Board Name,00A0,Override Manuf,cape-universaln
> debian@beaglebone:~$ config-pin -i P9.19
> Pin is not modifyable: P9_19 i2c2_scl
> debian@beaglebone:~$ config-pin -i P9.20
> Pin is not modifyable: P9_20 i2c2_sda
> debian@beaglebone:~$
>
> It looks like everything is okay.  Am I missing any steps?  I saw some info
> about adding an I2C overlay.  Is that still necessary with the universal
> cape?
>
> BTW, I also tried the 4.4.54-ti-r93 kernel without success.
>
> Thanks for any advice.  This noob is stumped.  :-)

the i2c port on P9_19/P9_20 is already enabled by default.

Regards,


-- 
Robert Nelson
https://rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYh3JNpsbutBNq_FHASJ7WAHtev7MsxYH%2BWPiRMPptE3Hw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] What is the best free solution to develop a GUI application on a BB with LCD3 cape as of 2017?

2017-06-17 Thread William Hermans
On Sat, Jun 17, 2017 at 7:33 PM, Robert Nelson 
wrote:

> On Sat, Jun 17, 2017 at 9:28 PM, 'LV LV' via BeagleBoard
>  wrote:
> >
> > I want to develop something for my home that has a GUI on the BB with
> LCD3
> > cape.
> > At $1000/year Qt (one of my favorite dev environment) is no longer an
> > option.
> > I probably would have spent $29/Month to have access to it but at
> $1000/Year
> > that is just too much to bear for personal use.
> > For years I pushed students to use Qt so they would learn C++ in the
> > process, all with great success, unfortunately I have to turn them to
> Java
> > instead now.
> >
> >
> > So what is the best solution available to develop a GUI application on a
> BB
> > with LCD3 cape as of 2017?
> >
>
> Well, pick a different "IDE" (one that doesn't cost $1K), not much is
> stopping you from using QT.
>
>
Right QT is first, and foremost an API, or graphics SDK that I do believe
has to be freely available as open source. Due to the licensing
requirements of Linux. The IDE on the other hand I've never really found
useful personally.

So the only real problem is knowing how to use the QT framework / library,
on which there are many good videos on youtube. Heres a series I remember
watching several years ago when I was curious about QT. I would not say
"bucky" is an expert programmer, but he has like 50 to 75 videos on QT,
each talking about specific parts of QT widgets, and what not.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORpyhRbTOJsyCXt8iJvVC%3De1abAdH_%2BKMnd-Z-6%3D0p0v-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] I2C with Debian 8.7 and universal cape?

2017-06-17 Thread mark whitney
Hello,

I'm trying to work through the I2C examples in the Molloy book.  But I'm 
using a Honeywell HMC6352 compass since I had one lying around.  It can 
work from 2.7V to 5V and operates at a bus frequency of 100KHz.  I verified 
that it works by hooking it up to a 5V microcontroller.  I can query its 
registers.  But I haven't had any luck communicating with it on a 
BeagleBone Black.

I'm using 3.9V pull-up resistors for SDA and SCL.  Here is info about my 
kernel version, cape slots, and the I2C pins:

debian@beaglebone:~$ uname -a
Linux beaglebone 4.4.54-bone16 #1 Fri Mar 17 04:56:31 UTC 2017 armv7l 
GNU/Linux
debian@beaglebone:~$ sudo cat $SLOTS
 0: PF  -1
 1: PF  -1
 2: PF  -1
 3: PF  -1
 4: P-O-L-   0 Override Board Name,00A0,Override Manuf,cape-universaln
debian@beaglebone:~$ config-pin -i P9.19
Pin is not modifyable: P9_19 i2c2_scl
debian@beaglebone:~$ config-pin -i P9.20
Pin is not modifyable: P9_20 i2c2_sda
debian@beaglebone:~$

It looks like everything is okay.  Am I missing any steps?  I saw some info 
about adding an I2C overlay.  Is that still necessary with the universal 
cape?

BTW, I also tried the *4.4.54-ti-r93* kernel without success.

Thanks for any advice.  This noob is stumped.  :-)



-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/d6f8e3c9-7825-4141-bae9-04c081109d1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] What is the best free solution to develop a GUI application on a BB with LCD3 cape as of 2017?

2017-06-17 Thread Robert Nelson
On Sat, Jun 17, 2017 at 9:28 PM, 'LV LV' via BeagleBoard
 wrote:
>
> I want to develop something for my home that has a GUI on the BB with LCD3
> cape.
> At $1000/year Qt (one of my favorite dev environment) is no longer an
> option.
> I probably would have spent $29/Month to have access to it but at $1000/Year
> that is just too much to bear for personal use.
> For years I pushed students to use Qt so they would learn C++ in the
> process, all with great success, unfortunately I have to turn them to Java
> instead now.
>
>
> So what is the best solution available to develop a GUI application on a BB
> with LCD3 cape as of 2017?
>

Well, pick a different "IDE" (one that doesn't cost $1K), not much is
stopping you from using QT.

Regards,

-- 
Robert Nelson
https://rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYhk8zc0uyiM7vD2m7UeqLWXkGGudRspDfHJi%3DFwsxif3A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] What is the best free solution to develop a GUI application on a BB with LCD3 cape as of 2017?

2017-06-17 Thread 'LV LV' via BeagleBoard

I want to develop something for my home that has a GUI on the BB with LCD3 
cape.
At $1000/year Qt (one of my favorite dev environment) is no longer an 
option.
I probably would have spent $29/Month to have access to it but at 
$1000/Year that is just too much to bear for personal use.
For years I pushed students to use Qt so they would learn C++ in the 
process, all with great success, unfortunately I have to turn them to Java 
instead now.


*So what is the best solution available to develop a GUI application on a 
BB with LCD3 cape as of 2017?*


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/49e8a8a5-e026-442f-9b19-4ba57f1a0c03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] Cross Toolchain for QTE 4.8 on Angstrom

2017-06-17 Thread 'LV LV' via BeagleBoard
Hello,

I am looking for the Angstrom cross toolchain for QT Enbedded 4.8.0 
development.
It looks like the Angstrom-distribution site is not maintained anymore.
I looked into the Git repo at 
https://github.com/Angstrom-distribution/buildhistory but I don't find what 
I am looking for.

The file I am looking for should look something like that: 

angstrom--xx-i686-linux-gnueabi-toolchain-qte-4.8.0.tar.bz2

Where -xx represents year-month.

I need that to pick back up on a project that was left on the shelf for far 
too long and unfortunately the machine I was using for cross compiling has 
since then died so I need to setup the tool-chain on a new development 
machine.

Thank you.


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/f379d92c-5e5d-43c0-ae9d-bd6dd7d35261%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Re: i2c python

2017-06-17 Thread Graham Haddock
Sounds like you can move ahead, and learn a little python.
--- Graham

==

On Fri, Jun 16, 2017 at 4:01 PM,  wrote:

> now I can read :)
>
> this script works
>
> import smbus
>
> # General i2c device class so that other devices can be added easily
> class i2c_device:
> def __init__(self, addr, port):
> self.addr = addr
> self.bus = smbus.SMBus(port)
>
> def write_i2c_block_data(self, byte, array):
> self.bus.write_i2c_block_data(self.addr, byte, array)
>
> def read_nbytes_data(self, data, n): # For sequential reads > 1 byte
> return self.bus.read_i2c_block_data(self.addr, data, n)
>
> ph = i2c_device(0x65, 2)
> ph.write_i2c_block_data(0x05,[0x00]) // off LED
> print(ph.read_nbytes_data(0x00, 25)) // read all registers
>
>
>
> On Friday, June 16, 2017 at 1:34:04 PM UTC-4, Sebastián Sáez wrote:
>>
>> This are the value in hexadecimal of the 25 registers in the sensor,
>> check with datasheet and it's ok
>>
>> 1,4,1,65,0,1,0,1,0,0,0,0,0,0,0,0,9,C4,0,0,9,C4,0,0,16
>>
>>
>> I used arduino to read this, I discovered that what I read with python is
>> garbage
>>
>> On Friday, June 16, 2017 at 12:43:14 PM UTC-4, Sebastián Sáez wrote:
>>>
>>> Hi Graham, thanks
>>>
>>> here more info
>>>
>>> HW: Beaglebone seeedstudio green wireless
 OS: Debian GNU/Linux 8.8 (jessie)
 Kernel: Linux beaglebone 4.4.30-ti-r64
 Python: Python 2.7.9
>>>
>>>
>>> I made a custom cape, the sensor it's power with 3.3v and conected to
>>> I2C_2 through an isolator
>>>
>>> SDA -> P9.20
>>> SCL -> P9.19
>>>
>>>
>>> 
>>>
>>> The HW it's OK, I check with an arduino and example code and I can write
>>> registers with my python script on the beaglebone.
>>>
>>> The ph sensor is in 0x65 address and other Atlas sensor in 0x64
>>>
>>> debian@beaglebone:~$ i2cdetect -y -r 2
>>>  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
>>> 00:  -- -- -- -- -- -- -- -- -- -- -- -- --
>>> 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> 50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- --
>>> 60: -- -- -- -- 64 65 -- -- -- -- -- -- -- -- -- --
>>> 70: -- -- -- -- -- -- -- --
>>>
>>> Now I can write register with this script (can on/off onboard LED) but
>>> when I try to read all 25 register I get this
>>>
>>>
 1, 1, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0
>>>
>>>
>>> The first 2 bytes are the ID and FW, but I expect the rest to have
>>> values such as the pH (registers 0x16, 0x17, 0x18, 0x19) but I am getting
>>> only 0 (garbage)
>>>
>>> Python script
>>> import smbus
>>> import time
>>>
>>> class i2c_device:
>>> def __init__(self, addr, port):
>>> self.addr = addr
>>> self.bus = smbus.SMBus(port)
>>>
>>> def write(self, byte):
>>> self.bus.write_byte(self.addr, byte)
>>>
>>> def write_i2c_block_data(self, byte, array):
>>> self.bus.write_i2c_block_data(self.addr, byte, array)
>>>
>>> def read(self):
>>> return self.bus.read_byte(self.addr)
>>>
>>> def read_nbytes_data(self, data, n): # For sequential reads > 1 byte
>>> return self.bus.read_i2c_block_data(self.addr, data, n)
>>>
>>> ph = i2c_device(0x65, 2)
>>> ph.write(0x00)
>>> i=0
>>> while (i <= 25):
>>> print(ph.read())
>>> time.sleep(0.5)
>>> i+=1
>>>
>>>
>>>
>>>
>>> On Thursday, June 15, 2017 at 10:38:28 PM UTC-4, Graham wrote:

 OK.
 Let's start with some background information.
 What model of Beaglebone?
 What version of OS, kernel?
 Which version of Python?
 How is the pH sensor hooked to the Beaglebone?
 What Voltage are you using to power the pH sensor?

 Now some basics to see if the I2C bus is running

 sudo apt-get install i2c-tools

 now run
 i2cdetect -y -r 1
 what do you get?

 now run
 i2cdetect -y -r 2
 what do you get?

 When you say that you get "garbage" what do you mean?
 What do you actually get? errors? tracebacks? obviously wrong data, but
 no reported errors?

 --- Graham

 ==

 On Thursday, June 15, 2017 at 5:38:58 PM UTC-5, Sebastián Sáez wrote:
>
>
> Hi,
>
> I'm writing a python script to communicate via i2c with the ph oem
> sensor from Atlas Scientific.
>
> https://www.atlas-scientific.com/product_pages/oem/oem_ph.html
> https://www.atlas-scientific.com/_files/_datasheets/_oem/pH_
> oem_datasheet.pdf
>
> I already tried with the i2c module of mraa and smbus without luck.
> Now I am trying to translate this arduino example from Atlas to python
> but I read garbage
>
>
> Any suggestions?, attached the full example arduino code
>
>
> *Atlas arduino code*
> byte i2c_device_address=0x65;
> byte starting_register=0x00
>

[beagleboard] WiFi problems, PREEMPT_RT, and connman (kernel 4.4.54)

2017-06-17 Thread mark whitney
Greetings,

*Quick summary:  I ran into some problems with WiFi after installing 
PREEMPT_RT packages.  But I found a workaround.*

I just bought a BBB Rev. C and installed the latest software image from 
beagleboard.org
*bone-debian-8.7-iot-armhf-2017-03-19-4gb.img.xz*

I also purchased an Edimax EW-7811Un N150 Nano USB WiFi adapter.  With that 
stock image, I was able to get a working Wifi connection by following the 
connmanctl comments in the */etc/network/interfaces* file.  It would power 
up and connect automatically after shutting down the BBB and restarting it.

I also wanted to try out the *PREEMPT_RT* features, so I installed the 
following packages:

linux-image-4.4.54-bone-rt-r16
linux-firmware-image-4.4.54-bone-rt-r16
rtl8723bu-modules-4.4.54-bone-rt-r16
ti-sgx-es8-modules-4.4.54-bone-rt-r16
ti-sgx-es9-modules-4.4.54-bone-rt-r16

I wasn't sure if I needed anything other than the linux image but I 
installed all that other stuff anyway.  After installing and rebooting, 
entering the command "uname -a" shows:

Linux beaglebone 4.4.54-bone-rt-r16 #1 PREEMPT RT Fri Mar 17 08:46:38 UTC 
2017 armv7l GNU/Linux

I also did a *sudo apt-get upgrade*.

Unfortunately, after doing all of those things, I didn't have any luck 
getting the wifi working again.  It may have worked once or twice after 
manually popping the wifi adapter in and out and reconfiguring things 
manually.  But I couldn't get it to power up and connect automatically 
again after shutting down the BBB and restarting it.

I finally got my wifi working again.  Here are the steps in case anybody 
has a similar problem or can suggest a simpler solution after reading them:

1. I wasn't comfortable with connman so I got rid of it.

> sudo apt-get remove --purge connman

2. I tried to enable wlan0 in */etc/network/interfaces* but it was getting 
renamed to some long string based on the wifi adapter's MAC address!  
Nothing seemed to worked with that new name.  After googling, it seems lots 
of folks have had that problem.  Here is a workaround I found for that:

Create a file called: */etc/udev/rules.d/10-network.rules*

If wifi MAC is aa:bb:cc:dd:ee:ff, then add a single line of text to that 
file:

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="aa:bb:cc:dd:ee:ff", 
NAME="wlan0"

3.  I used the steps in Molloy's book to create a */etc/wpa.conf* file for 
the wifi credentials.

> sudo ifup wlan0

The blue light came on in the USB wifi adapter.

> iwlist wlan0 scan

Info about the wlan0 link appeared.

> su root
> sudo wpa_passphrase   > /etc/wpa.conf
> exit

Then I did some hand-editing based on the iwlist info.  My */etc/wpa.conf* 
file looked like:

network={
ssid=""
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
psk=
}

4.  I had problems with DHCP unless I manually assigned the gateway.  So I 
assigned a static IP in the settings for wlan0 in the 
*/etc/network/interfaces* file.  Note the additional line for apply the 
*/etc/wpa.conf* file.

auto wlan0
iface wlan0 inet static
address 192.168.2.202
netmask 255.255.255.0
gateway 192.168.2.1
wpa-conf /etc/wpa.conf

5.  I had problems unless eth0 was down.  So I commented out auto eth0 in 
*/etc/network/interfaces*.

Voila!  My wifi powers up and connects automatically after shutting down 
and restarting my BBB.

(BTW, I entered all commands and did all edits through a serial debug cable 
connection.)

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/7cf23251-ddbc-419b-a3c4-630e2c72b64c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] Re: i2c python

2017-06-17 Thread ssaez
now I can read :)

this script works

import smbus

# General i2c device class so that other devices can be added easily
class i2c_device:
def __init__(self, addr, port):
self.addr = addr
self.bus = smbus.SMBus(port)

def write_i2c_block_data(self, byte, array):
self.bus.write_i2c_block_data(self.addr, byte, array)

def read_nbytes_data(self, data, n): # For sequential reads > 1 byte
return self.bus.read_i2c_block_data(self.addr, data, n)

ph = i2c_device(0x65, 2)
ph.write_i2c_block_data(0x05,[0x00]) // off LED
print(ph.read_nbytes_data(0x00, 25)) // read all registers



On Friday, June 16, 2017 at 1:34:04 PM UTC-4, Sebastián Sáez wrote:
>
> This are the value in hexadecimal of the 25 registers in the sensor, check 
> with datasheet and it's ok
>
> 1,4,1,65,0,1,0,1,0,0,0,0,0,0,0,0,9,C4,0,0,9,C4,0,0,16
>
>
> I used arduino to read this, I discovered that what I read with python is 
> garbage
>
> On Friday, June 16, 2017 at 12:43:14 PM UTC-4, Sebastián Sáez wrote:
>>
>> Hi Graham, thanks
>>
>> here more info
>>
>> HW: Beaglebone seeedstudio green wireless
>>> OS: Debian GNU/Linux 8.8 (jessie)
>>> Kernel: Linux beaglebone 4.4.30-ti-r64
>>> Python: Python 2.7.9
>>
>>
>> I made a custom cape, the sensor it's power with 3.3v and conected to 
>> I2C_2 through an isolator
>>
>> SDA -> P9.20
>> SCL -> P9.19
>>
>>
>> 
>>
>> The HW it's OK, I check with an arduino and example code and I can write 
>> registers with my python script on the beaglebone.
>>
>> The ph sensor is in 0x65 address and other Atlas sensor in 0x64
>>
>> debian@beaglebone:~$ i2cdetect -y -r 2
>>  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
>> 00:  -- -- -- -- -- -- -- -- -- -- -- -- --
>> 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> 50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- --
>> 60: -- -- -- -- 64 65 -- -- -- -- -- -- -- -- -- --
>> 70: -- -- -- -- -- -- -- --
>>
>> Now I can write register with this script (can on/off onboard LED) but 
>> when I try to read all 25 register I get this
>>   
>>
>>> 1, 1, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
>>
>>
>> The first 2 bytes are the ID and FW, but I expect the rest to have values 
>> such as the pH (registers 0x16, 0x17, 0x18, 0x19) but I am getting only 0 
>> (garbage)
>>
>> Python script
>> import smbus
>> import time
>>
>> class i2c_device:
>> def __init__(self, addr, port):
>> self.addr = addr
>> self.bus = smbus.SMBus(port)
>>
>> def write(self, byte):
>> self.bus.write_byte(self.addr, byte)
>>
>> def write_i2c_block_data(self, byte, array):
>> self.bus.write_i2c_block_data(self.addr, byte, array)
>>
>> def read(self):
>> return self.bus.read_byte(self.addr)
>>
>> def read_nbytes_data(self, data, n): # For sequential reads > 1 byte
>> return self.bus.read_i2c_block_data(self.addr, data, n)
>>
>> ph = i2c_device(0x65, 2)
>> ph.write(0x00)
>> i=0
>> while (i <= 25):
>> print(ph.read())
>> time.sleep(0.5)
>> i+=1
>>
>>
>>
>>
>> On Thursday, June 15, 2017 at 10:38:28 PM UTC-4, Graham wrote:
>>>
>>> OK.
>>> Let's start with some background information.
>>> What model of Beaglebone?
>>> What version of OS, kernel?
>>> Which version of Python? 
>>> How is the pH sensor hooked to the Beaglebone?
>>> What Voltage are you using to power the pH sensor?
>>>
>>> Now some basics to see if the I2C bus is running
>>>
>>> sudo apt-get install i2c-tools
>>>
>>> now run
>>> i2cdetect -y -r 1
>>> what do you get?
>>>
>>> now run
>>> i2cdetect -y -r 2
>>> what do you get?
>>>
>>> When you say that you get "garbage" what do you mean?
>>> What do you actually get? errors? tracebacks? obviously wrong data, but 
>>> no reported errors?
>>>
>>> --- Graham
>>>
>>> ==
>>>
>>> On Thursday, June 15, 2017 at 5:38:58 PM UTC-5, Sebastián Sáez wrote:


 Hi,

 I'm writing a python script to communicate via i2c with the ph oem 
 sensor from Atlas Scientific.

 https://www.atlas-scientific.com/product_pages/oem/oem_ph.html

 https://www.atlas-scientific.com/_files/_datasheets/_oem/pH_oem_datasheet.pdf

 I already tried with the i2c module of mraa and smbus without luck. 
 Now I am trying to translate this arduino example from Atlas to python 
 but I read garbage


 Any suggestions?, attached the full example arduino code


 *Atlas arduino code*
 byte i2c_device_address=0x65;
 byte starting_register=0x00
 byte device_type;
 byte version_number;
 Wire.beginTransmission(i2c_device_address);
 Wire.write(staring_register);
 Wire.endTransmission();
 Wire.requestFrom(i2c_device_address,(byte)2);
 device_type = Wire.read();
 version_number = Wire.read();
 Wire.endTran