That's pretty bad, it shouldn't be like that. The next step would be writing a script which diffs expected with actual (bad) output. If you can do that, please post the output as a bug to https://github.com/micropython/micropython . If not, you can either diff manually, or wait when someone else writes such a script. All in all, I'd treat the issues above seriously, and would be happy to look into them - as long as there's enough information provided.on BBB running make test I get the following...
why linux and windows builds
Re: why linux and windows builds
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: why linux and windows builds
Nope, unlikely. But we're approaching that (being able to use I2C on any board with minimal efforts), e.g. with https://github.com/micropython/micropython/pull/1611 . But it would take some time to get it to state when it "just works". The limiting factor here is that so far nobody really needed to use I2C communication on a Linux board with MicroPython. So, the more there're people interested in it, and more active they are, the sooner it will be possible.so my question is... how can I do i2c access anyone done this?
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
-
- Posts: 70
- Joined: Wed Oct 14, 2015 5:07 pm
Re: why linux and windows builds
@pflacon thanks, ill try to do as you ask, but I'm a real newbie at this stuff.
fwiw I was thinking of using ffi to talk to the libc library... cos to do i2c I just need open and ioctl, (as per java jna implementation).
My original implementation was in java but I discovered python and fell in love, at the moment I am using the bbb default python, and the pybbbio library, but it would be fun to use upython instead
fwiw I was thinking of using ffi to talk to the libc library... cos to do i2c I just need open and ioctl, (as per java jna implementation).
My original implementation was in java but I discovered python and fell in love, at the moment I am using the bbb default python, and the pybbbio library, but it would be fun to use upython instead
Re: why linux and windows builds
Good plan. If you have a known working library, interfacing with it using FFI is the most straightforward way. You can find a lot of FFi usage examples in https://github.com/micropython/micropython-lib
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
-
- Posts: 70
- Joined: Wed Oct 14, 2015 5:07 pm
Re: why linux and windows builds
actually I was hoping to use ffi directly to libc...
I have got open("/dev/i2c-2", O_RDWR) to work
also ioctl(fd, I2C_SLAVE, 0x48)
but struggling with the read and write any help gratefully appreciated.
ps doesn't this mean that this would work on any Linux distro? with an i2c file api?
Code: Select all
import ffi
O_RDWR = 2
I2C_SLAVE = \x0703
libc = ffi.open("libc.so.6")
open=libc.func("i", "open", "si")
ioctl=libc.func("i", "ioctl", "iii")
read=libc.func("i", "read", "ipi")
write = libc.func("i", "write", "ipi")
also ioctl(fd, I2C_SLAVE, 0x48)
but struggling with the read and write any help gratefully appreciated.
ps doesn't this mean that this would work on any Linux distro? with an i2c file api?
Re: why linux and windows builds
Yes. As soon as you figure out that ioctl and read/write stuff. But for example using bitbanging will work just anywhere, not just on Linux (and "on Linux" means "Linux kernel which has appropriate I2C driver"). Of course, perhaps slowly, etc. But who cares - what's really slow is figuring out that boring ioctl and read/write stuff. (Though of course it needs to be done once, and if you take care to share it with other people, they'll do something else cool which may be of use to you later.)ps doesn't this mean that this would work on any Linux distro? with an i2c file api?
As for specifics, maybe someone else can help. If I'd do it, I'd take some existing known working code (e.g. i2c-tools) and looked how it does that.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: why linux and windows builds
I thought I posted this but I must have forgotten to hit Submit.
I have some C code which uses the I2C_RDWR ioctl call to talk to i2c devices.
https://github.com/dhylands/robostix/bl ... /i2c-api.c
In particular, the core bit is the I2cTransfer function. It has a bunch of wrappers which convert many of the various smbus protocols into a call to I2cTransfer.
The smbus spec is here: http://smbus.org/specs/SMBus_3_0_20141220.pdf and chapter 6 covers the various protocols.
I have some C code which uses the I2C_RDWR ioctl call to talk to i2c devices.
https://github.com/dhylands/robostix/bl ... /i2c-api.c
In particular, the core bit is the I2cTransfer function. It has a bunch of wrappers which convert many of the various smbus protocols into a call to I2cTransfer.
The smbus spec is here: http://smbus.org/specs/SMBus_3_0_20141220.pdf and chapter 6 covers the various protocols.
-
- Posts: 70
- Joined: Wed Oct 14, 2015 5:07 pm
Re: why linux and windows builds
thanks d - helpful as usual.
for my purposes, its easy to do, what I'm not clear about is how to pass in/out buffers to the ffi calls for read/write.
when I tried something I got a segmentation fault and it bombed out of micropython, anyway must be doable so ill plod on
for my purposes, its easy to do, what I'm not clear about is how to pass in/out buffers to the ffi calls for read/write.
when I tried something I got a segmentation fault and it bombed out of micropython, anyway must be doable so ill plod on
Re: why linux and windows builds
On Raspberry Pi the result is:
Code: Select all
454 tests performed (15564 individual testcases)
453 tests passed
21 tests skipped: cmd_showbc cmd_verbose native_closure native_const native_misc viper_args viper_binop_arith viper_binop_comp viper_binop_comp_imm viper_binop_multi_comp viper_cond viper_error viper_misc viper_ptr16_load viper_ptr16_store viper_ptr32_load viper_ptr32_store viper_ptr8_load viper_ptr8_store viper_subscr extra_coverage
1 tests failed: machine_mem
Makefile:144: recipe for target 'test' failed
make: *** [test] Error 1
Tiny Core Linux (piCore) developer
HAM radio call: HA5DI (Béla)
HAM radio call: HA5DI (Béla)
Re: why linux and windows builds
On Centos7:
Code: Select all
472 tests performed (15721 individual testcases)
472 tests passed
3 tests skipped: cmd_showbc cmd_verbose extra_coverage
Tiny Core Linux (piCore) developer
HAM radio call: HA5DI (Béla)
HAM radio call: HA5DI (Béla)