A little "Getting started" help

Discussion and questions about programming with Ultibo.
Zeropage
Posts: 7
Joined: Thu Mar 07, 2019 8:33 am

A little "Getting started" help

Postby Zeropage » Thu Mar 07, 2019 8:42 am

Hi

First off, Ultibo is awesome. I've built a basic project and can definitely see the power here.

The only thing I'm struggling with is moving the SD card every time I compile so I wanted to ask :

Is it be possible to write some kind of "Stub" that on boot could load the latest version of my program from the network and execute it ?

Or alternatively, I've seen that Telnet is supported, is there some way to transfer files ?

I'm a delphi developer with some years of experience so I'm fairly sure I could figure out how to set up some kind of a listening server, but when it comes to executing a downloaded file I'm not sure where to start.

If someone could point me at an example or has done something like this, it would be much appreciated.
Many thanks for your time.
User avatar
Ultibo
Site Admin
Posts: 2150
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: A little "Getting started" help

Postby Ultibo » Thu Mar 07, 2019 9:16 am

Zeropage wrote:The only thing I'm struggling with is moving the SD card every time I compile so I wanted to ask :

Is it be possible to write some kind of "Stub" that on boot could load the latest version of my program from the network and execute it ?

Or alternatively, I've seen that Telnet is supported, is there some way to transfer files ?

Hi Zeropage, welcome to Ultibo.

There are many ways to update your image without swapping the SD card, we've included a few links in the Updating and deploying applications section of the Forum Quick Reference to help in getting started.

The simplest choices include HTTP, TFTP and FTP and if you look around the forum you will probably find other ideas that have also been discussed.

Just ask if you need any more information.
Ultibo.org | Make something amazing
https://ultibo.org
Zeropage
Posts: 7
Joined: Thu Mar 07, 2019 8:33 am

Re: A little "Getting started" help

Postby Zeropage » Thu Mar 07, 2019 9:28 am

Many thanks.

I came across the FTP/TFTP example just after posting. :oops:
Zeropage
Posts: 7
Joined: Thu Mar 07, 2019 8:33 am

Re: A little "Getting started" help

Postby Zeropage » Thu Mar 07, 2019 11:29 am

Hi

Struggling a bit.

I've set my project up as per the TFTP example :

https://github.com/pjde/ultibo-tftp

But I'm getting some weird behaviour.. It seems to work the first time after I have manually copied the Kernel7.img file onto the SD card. it transfers and then reboots.

But after that if I try to send again I get "Connect request failed" on the PC side.

If I manually plug in the sd card, copy the kernal and then put it back into the PI it will work again, but only once.. After that I get the connect failure again.

I was wondering if anyone else has seen this kind of behaviour ?
Its Windows 10 and RasPI 2 with a wired connection.

I've switched off my firewall and created a rule in my router but that doesn't seem to make any difference.
pik33
Posts: 840
Joined: Fri Sep 30, 2016 6:30 pm
Location: Poland
Contact:

Re: A little "Getting started" help

Postby pik33 » Thu Mar 07, 2019 1:37 pm

One of possible solutions to avoid card swapping is:

Install Ultibo on the RPi/Raspbian and develop on RPi. Then a shell script can copy your compiled kernel7.img to /boot and reboot the RPi. If you add several lines of code to your project, it can restore Raspbian kernel so after reboot you will be again in Raspbian and continue developing/debugging.

To make things faster I have now Raspbian installed on SSD drive It is configured to start Ultibo automatically, so it takes about 17 seconds from reboot to working Ultibo IDE.

Card swapping is now needed only when I made a bug which prevents the program from restoring Raspbian core so I need to open /boot on a PC and manually rename files. This is now rare :)
Zeropage
Posts: 7
Joined: Thu Mar 07, 2019 8:33 am

Re: A little "Getting started" help

Postby Zeropage » Thu Mar 07, 2019 1:49 pm

pik33 wrote:One of possible solutions to avoid card swapping is:

Install Ultibo on the RPi/Raspbian and develop on RPi. Then a shell script can copy your compiled kernel7.img to /boot and reboot the RPi. If you add several lines of code to your project, it can restore Raspbian kernel so after reboot you will be again in Raspbian and continue developing/debugging.

To make things faster I have now Raspbian installed on SSD drive It is configured to start Ultibo automatically, so it takes about 17 seconds from reboot to working Ultibo IDE.

Card swapping is now needed only when I made a bug which prevents the program from restoring Raspbian core so I need to open /boot on a PC and manually rename files. This is now rare :)



yeah, sounds like a good workflow.

My problem is that I dont have a monitor that will take HDMI, so the PI is plugged into the TV in the living room.

I suppose I could do like you have and then remote into the PI but I really like the idea of updating the kernal over the network.
pik33
Posts: 840
Joined: Fri Sep 30, 2016 6:30 pm
Location: Poland
Contact:

Re: A little "Getting started" help

Postby pik33 » Thu Mar 07, 2019 2:24 pm

I dont have a monitor that will take HDMi


I had the same problem and I used something like this (not exactly this as my dongle has no cable, only sockets: https://kamami.pl/przewody-wideo/565851 ... results=23. This allowed me to connect RPi to VGA input of the monitor.

As my monitor can accept DVI, now I have another solution: hdmi->dvi converter and this switch: https://kamami.pl/akcesoria-hdmi/566240 ... jscia.html. The converter is connected to the monitor via DVI and to the switch via HDMI. This allows me to have 2 RPis and the PC to be connected to the monitor, still having VGA input free.

Links are examples only as I buy my RPi related stuff in this shop; both of these are cheap Chinese things available everywhere..
Zeropage
Posts: 7
Joined: Thu Mar 07, 2019 8:33 am

Re: A little "Getting started" help

Postby Zeropage » Thu Mar 07, 2019 2:27 pm

Well, I've kind of found a solution to this.

I downloaded "FTP Rush" (Freeware) which supports TFTP and that seems to work much better.

There seems to be a problem if
a) you upload the same file twice in a row.
b) you try to upload too frequently.

If you want to use this you might want to set it so that it always overwrites the target file, otherwise it will skip if the filesize is the same etc.
User avatar
Ultibo
Site Admin
Posts: 2150
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: A little "Getting started" help

Postby Ultibo » Thu Mar 07, 2019 11:14 pm

I know you found a sort of solution but we know a lot of people use the TFTP solution for uploading their images so it would be great if you could help clarify a bit what the issue was for you.

We normally use the HTTP option but just tested TFTP with the latest Ultibo release and we cannot reproduce anything similar to what you describe.

Zeropage wrote:But I'm getting some weird behaviour.. It seems to work the first time after I have manually copied the Kernel7.img file onto the SD card. it transfers and then reboots.

But after that if I try to send again I get "Connect request failed" on the PC side.

If I manually plug in the sd card, copy the kernal and then put it back into the PI it will work again, but only once.. After that I get the connect failure again.

It might help to break the problem down a little bit by making some additional checks:

When you get the "Connect request failed" message are you able to successfully ping the address of the Ultibo Pi?

Do you get "Connect request failed" immediately or does it take some time (30 to 60 seconds) and you also get a "Timeout occurred" message?

Is it the act of removing and reinserting the SD card that makes it work or is it unplugging and reconnecting the power? Does doing one without the other produce the same result?

Zeropage wrote:I downloaded "FTP Rush" (Freeware) which supports TFTP and that seems to work much better.

There seems to be a problem if
a) you upload the same file twice in a row.
b) you try to upload too frequently.

If you want to use this you might want to set it so that it always overwrites the target file, otherwise it will skip if the filesize is the same etc.

If replacing the TFTP client software fixes the problem then it might indicate a possible issue at the Windows end, the code in the Ultibo TFTP server doesn't seem to look at the file size at all and since it reboots after each successful upload I'm assuming these two issues are related to the client software.

PS. We also highly recommend the web status unit as a great way to see what is happening inside your Ultibo projects, it can save a lot of guessing and wondering.
Ultibo.org | Make something amazing
https://ultibo.org
Zeropage
Posts: 7
Joined: Thu Mar 07, 2019 8:33 am

Re: A little "Getting started" help

Postby Zeropage » Fri Mar 08, 2019 8:38 am

Hi

yeah, I'm inclined to agree, I think the problem is in my environment.

This morning I added the webstatus unit, built my project and uploaded it ..

I had a good browse of all the categories in the status page and all was well.

Then I uploaded the Kernal7 image again and everything went to pot .
So now if I try to go to the status page, I get "Error 404 (Not Found) " even if I power-cycle the PI. although a ping works fine.

Its the weirdest thing.

When I get some time I'm going to fire up wireshark and see if I can figure this out.

Return to “General”

Who is online

Users browsing this forum: No registered users and 2 guests