Remote programming a chipKIT Pi

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Remote programming a chipKIT Pi

Post by majenko » Tue Feb 16, 2016 4:39 pm

If you're interested in how it all works, and also so they don't get lost again, all the pi-side of things is on github: https://github.com/UECIDE/ckpi-support
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

keithsloan52
Posts: 30
Joined: Mon Dec 28, 2015 5:51 pm

Re: Remote programming a chipKIT Pi

Post by keithsloan52 » Tue Feb 16, 2016 5:02 pm

My UECIDE on the Mac 0.8.8alpha22 is not seeing the Raspberry Pi.

How can I check the mDNS service is up and running okay,

BTW in your instructions on Jessie /boot/cmdline is now /boot/cmdline.txt ( Well it is on my system )

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Remote programming a chipKIT Pi

Post by majenko » Tue Feb 16, 2016 5:06 pm

I have absolutely no idea on the mac. On Linux I use `avahi-browse -a` but that won't work on OS X.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Remote programming a chipKIT Pi

Post by majenko » Tue Feb 16, 2016 5:47 pm

If you want to specify the IP address of the Pi manually so it doesn't rely on mDNS to find it you can add this to the top of your sketch:

Code: Select all

#pragma parameter ip=192.168.0.38
That will then use the IP you provide there for the upload.

Also useful if the Pi is on a different network segment, or on the internet somewhere.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

keithsloan52
Posts: 30
Joined: Mon Dec 28, 2015 5:51 pm

Re: Remote programming a chipKIT Pi

Post by keithsloan52 » Tue Feb 16, 2016 6:08 pm

Okay I installed UECIDE on a Linux machine and the Pi does not show up
avahibrowse output as follows
list.txt
(2.4 KiB) Downloaded 21 times
The machine I am trying to program via is pi-three

I checked the etc/avahi/services/ckpi.service and its there on the Pi.
I tried a reboot.

I note the service uses port 22, Does that not clash with ssh?

Tried the #pragma and get a Timestamp error

Until I get a new crystal my bootloader only works at 9600. Is there a way to tell it to use 9600

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Remote programming a chipKIT Pi

Post by majenko » Tue Feb 16, 2016 6:14 pm

The timestamp error might be because of a difference in clock times between the Pi and your computer.

The avahi service just advertises a port, it doesn't "use" a port. You can have as many services pointing to the same port as you like. UECIDE uses SSH to copy the hex file across and then

To change the baud you will need to edit the chipkit-pi board.txt file to add a baud rate (-b 9600) to the pic32prog command:

Code: Select all

upload.pissh.script.3=__builtin_ssh::${board.user}@${ip}::ckpi-program && pic32prog -S -d /dev/ttyAMA0 -b 9600 /tmp/${filename}.hex && ckpi-reboot
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Remote programming a chipKIT Pi

Post by majenko » Tue Feb 16, 2016 6:27 pm

In fact you can edit the command to be anything you want that meets your needs. That whole block of text in the board.txt file is a script that copies the file and executes commands to upload. You can write your own script to do your own things if you like - even using socat and netcat and things to transfer data.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

keithsloan52
Posts: 30
Joined: Mon Dec 28, 2015 5:51 pm

Re: Remote programming a chipKIT Pi

Post by keithsloan52 » Tue Feb 16, 2016 6:41 pm

Okay my board file in Users/keith/Library/uecide/boards/chipKIT/chipkit-pi Had

upload.pissh.script.3=__builtin_ssh::${board.user}@${ip}::ckpi-program && avrdude -V -p${build.mcu} -P/dev/ttyAMA0 -b${upload.speed} -C/etc/avrdude-ckpi.conf -cstk500v2 -Uflash:w:/tmp/${filename}.hex:i ${verbose} && ckpi-reboot

I assume because you altered your system and I have the installed dmg from a few days ago.

I changed to
upload.pissh.script.3=__builtin_ssh::${board.user}@${ip}::ckpi-program && pic32prog -S -d /dev/ttyAMA0 -b 9600 /tmp/${filename}.hex && ckpi-reboot

Added the #pragma ip=192.168.1.17

Now I get an error following Uploading firmware image
com.jcraft.jsch.JSchException : Algorithm negotiation fail

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Remote programming a chipKIT Pi

Post by majenko » Tue Feb 16, 2016 6:48 pm

Updating the chipkit Pi board in the plugin manager should have changed all that. It should also have added a few other things to the file as well that were stopping it from finding the board with mDNS. You did update the board like I said, didn't you?
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

keithsloan52
Posts: 30
Joined: Mon Dec 28, 2015 5:51 pm

Re: Remote programming a chipKIT Pi

Post by keithsloan52 » Tue Feb 16, 2016 9:18 pm

Sorry about that. I got mislead as it says latest available 10.9.0 installed 10.9.0
I had to click refresh to see that the latest was 10.9.1

Have now updated to 10.9.1 But still have the same problem on the Mac with the java error.
Would post more details but I cannot figure out how to cut & paste from the console view.

On my linux machine it says timestamp error. Times on the two machines are more or less the same.
They both get their time from the internet but Pi is UTC and unix is GMT.

I note that the Mac is also GMT and it does not give the timestamp error.

Its now finding the Pi and offering upload via a remote Pi at 192.168.1.17

Post Reply