Search found 70 matches

by Peter.Kenyon
Thu Dec 17, 2015 4:02 pm
Forum: Programs, Libraries and Tools
Topic: Notes on porting code to pyboard
Replies: 1
Views: 4133

Notes on porting code to pyboard

Just spent a pleasant afternoon porting some BBB code to the pyboard. The code presents a socket interface and controls various devices on the i2c bus. Instead of a socket I just used input and stdout The package structure and imports was flawless, I was expecting all sorts of issues but none Loggin...
by Peter.Kenyon
Tue Dec 01, 2015 10:49 am
Forum: General Discussion and Questions
Topic: why linux and windows builds
Replies: 31
Views: 22872

Re: why linux and windows builds

apart from the socket failing to bind to any adapter server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind(("", 9090)) Traceback (most recent call last): File "main.py", line 47, in File "main.py", line 22, in run File "/root/.micropython/lib/socket.py", line 37, in bind File "/root...
by Peter.Kenyon
Tue Dec 01, 2015 10:20 am
Forum: General Discussion and Questions
Topic: why linux and windows builds
Replies: 31
Views: 22872

Re: why linux and windows builds

I doubled that line and it gets a bit further, so well spotted... still finding inconsistencies but we progress....

Code: Select all

    mp_stack_set_limit(/*PK*/2*40000 * (BYTES_PER_WORD / 4));
by Peter.Kenyon
Mon Nov 30, 2015 1:45 pm
Forum: General Discussion and Questions
Topic: why linux and windows builds
Replies: 31
Views: 22872

Re: why linux and windows builds

Ive just tried running some code on the BBB which runs fine with python and python3, but when I run it with micropython I get... Traceback (most recent call last): File "main.py", line 8, in <module> File "/root/Python-Slide/connection.py", line 4, in <module> File "/root/Python-Slide/command.py", l...
by Peter.Kenyon
Mon Nov 30, 2015 9:17 am
Forum: General Discussion and Questions
Topic: why linux and windows builds
Replies: 31
Views: 22872

Re: why linux and windows builds

@pfalcon. OK I had a look at the *.exp and *.out files, and there is something weird going on, I think the tests all worked except the .exp files for the failures all contain just the one line CPYTHON3 CRASH eg here is bytes.py.exp CPYTHON3 CRASH and here is bytes.py.out b'123' b'123' b'123' b'\\u12...
by Peter.Kenyon
Fri Nov 27, 2015 6:45 am
Forum: General Discussion and Questions
Topic: why linux and windows builds
Replies: 31
Views: 22872

Re: why linux and windows builds

@pfalcon, mmm it looks like I reinvented the os, fcntl modules :oops: , to be fair I did look in the python-lib repository at the os and saw an __init__ .py which, with my limited python experience I assumed was empty. on the make test issue for BBB, I can get a dump of the actual errors, but I'm no...
by Peter.Kenyon
Thu Nov 26, 2015 7:36 am
Forum: General Discussion and Questions
Topic: why linux and windows builds
Replies: 31
Views: 22872

Re: why linux and windows builds

interesting I would have thought BBB and RPi were similar, but its all new to me... btw I got i2c to work with the following, import ffi libc = ffi.open("libc.so.6") print( "libc: ", libc ) open = libc.func("i", "open", "si") ioctl = libc.func("i", "ioctl", "iii") read = libc.func("i", "read", "ipi"...
by Peter.Kenyon
Thu Nov 26, 2015 6:23 am
Forum: General Discussion and Questions
Topic: why linux and windows builds
Replies: 31
Views: 22872

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
by Peter.Kenyon
Wed Nov 25, 2015 7:13 pm
Forum: General Discussion and Questions
Topic: why linux and windows builds
Replies: 31
Views: 22872

Re: why linux and windows builds

actually I was hoping to use ffi directly to libc... 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") I have got open("/dev/i2c-2", O_...
by Peter.Kenyon
Wed Nov 25, 2015 3:03 pm
Forum: General Discussion and Questions
Topic: why linux and windows builds
Replies: 31
Views: 22872

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,...