Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install infragram #37

Closed
wants to merge 9 commits into from
Closed

Install infragram #37

wants to merge 9 commits into from

Conversation

jywarren
Copy link
Member

Thanks for opening a pull request! In this repository, opening a PR will initiate the generation of a new Raspberry Pi image, and create an image file you can download and use in your Raspberry Pi.

The changes you add to the pull request, such as adding software to install, will be run on the generated image.

For an example, see the software installed and configured in this pull request: https://github.com/publiclab/image-builder-rpi/pull/15/files

Recipe

Use this space to describe what your "recipe" is intended to install and configure on a Raspberry Pi:

Installing Infragram multispectral analysis tool: https://github.com/publiclab/infragram


Download instructions

Generating the image will take a few minutes. Once the image is prepared, and if it succeeded, you'll see a green checkmark at the bottom of the pull request. To download the image:

  1. click the green checkmark; you'll go to a page at a URL like https://gitlab.com/publiclab/image-builder-rpi/pipelines/########/builds
  2. On this page, click the Jobs tab, next to Pipeline
  3. Click the green Passed button
  4. Click Download in the right-hand sidebar
  5. Unzip the artifacts.zip file, and also the hypriotos-rpi-camera_web.img.zip within it
  6. Use a program like https://etcher.io/ to flash it to an SD card

You'll also be able to read the output of the image generation in this window.

We hope to create a bot to report back the completed image URL in each pull request. If you can help create such a bot, please contact us at:

#16

Thanks!

@jywarren
Copy link
Member Author

Oh, did our rename break the building system, @icarito ? Sorry!!!

@icarito
Copy link
Member

icarito commented Oct 23, 2018

No the rename didn't break the build. There was a temporary network issue I think. I retried and now it failed because npm isn't installed.

@jywarren
Copy link
Member Author

jywarren commented Oct 23, 2018

What's the ideal way to install npm -- trying sudo apt-get install nodejs npm node-semver per https://raspberrypi.stackexchange.com/questions/4194/getting-npm-installed-on-raspberry-pi-wheezy-image

@maykef
Copy link

maykef commented Oct 23, 2018

Hi,
I think is a better idea to implement image-sequencer within the pi-image, rather than infragram.
The other thing to take into consideration, at least in my case, is that the compute module has just 4GB of space and therefore any image bigger than that would not be suitable for it. I've got an image for the CM 3 with opencv installed, and maybe there is space for image-sequencer. That would make it a killer in processing terms

@jywarren
Copy link
Member Author

jywarren commented Oct 23, 2018 via email

@jywarren
Copy link
Member Author

@jywarren
Copy link
Member Author

So once we get this running, we should be able to just swap "infragram" with "image-sequencer" in a new PR and then it should work there too. They have similar node/npm dependencies!

@jywarren
Copy link
Member Author

Ah, we're now running out of space -- is there a way to expand the image?

tar: ./node-v9.7.1-linux-armv6l: Cannot mkdir: No space left on device
tar: ./node-v9.7.1-linux-armv6l/lib/node_modules/npm/lib/install/exists.js: Cannot open: No such file or directory

@icarito
Copy link
Member

icarito commented Oct 24, 2018

Yes! I ran into the same issue while trying to integrate Peggy scripts + Desktop environment.
Please see https://github.com/publiclab/pi-builder/pull/12/files#diff-55f0a4e44112d8684fa3f85db6490f3cL87

This replaces the standard hypriot root base filesystem with a custom built one by us in Jenkins (set to 2GB instead of 1GB images).

@icarito
Copy link
Member

icarito commented Oct 24, 2018

The repository for the enlarged rootfs is at https://gitlab.com/publiclab/image-builder-raw

@jywarren
Copy link
Member Author

OK! Added that to increase the image size. Awesome, thanks!

@jywarren
Copy link
Member Author

jywarren commented Oct 24, 2018

Hmm, i'm seeing this error now:

+ wget -q -O /workspace/rpi-raw.img.zip https://jenkins.laboratoriopublico.org/job/image-builder-raw/ws/rpi-raw.img.zip
+ sha256sum -c -
+ echo '2fbeb13b7b0f2308dbd0d82780b54c33003ad43d145ff08498b25fb8bbe1c2c6 /workspace/rpi-raw.img.zip'
/workspace/rpi-raw.img.zip: FAILED
sha256sum: WARNING: 1 computed checksum did NOT match

I'm restarting it to see, but any ideas what this is about? Thanks!

@jywarren
Copy link
Member Author

@icarito
Copy link
Member

icarito commented Oct 24, 2018

Yes, it is necessary to update the checksum too, forgot to mention it: https://github.com/publiclab/pi-builder/pull/12/files#diff-228984280290be5309df88a7d32cf31dL8

@jywarren
Copy link
Member Author

It worked!!!

@jywarren
Copy link
Member Author

Er, did it? Oh, it doesn't seem to have triggered.

@jywarren jywarren closed this Oct 24, 2018
@jywarren jywarren reopened this Oct 24, 2018
@icarito
Copy link
Member

icarito commented Oct 24, 2018

How strange, this should trigger automatically...

@icarito
Copy link
Member

icarito commented Oct 24, 2018

I found a webhook confused about the old URL, fixing it...

@jywarren
Copy link
Member Author

jywarren commented Oct 24, 2018

@jywarren
Copy link
Member Author

It worked!!! OK, so now I have to rebase this or combine it with commits from https://github.com/publiclab/pi-builder/pull/13/files, because we actually need that installed to be able to route the video stream into Infragram as per:

https://publiclab.org/questions/warren/12-05-2017/how-can-we-stream-video-to-spectralworkbench-org-or-infragram-org-from-a-raspberry-pi-camera

@jywarren
Copy link
Member Author

jywarren commented Oct 24, 2018

Looks like you can just load it as an image using this code, and insert it:

var piImage = new Image();
piImage.onload = function() {
  infragram.options.processor.updateImage(piImage);
}
var fetchImageInterval = setInterval(function fetchImage() {
  piImage.src = "http://pi.local/cam/cam_pic.php?time=" + new Date().getTime();
}, 200);

(Updated again)

@jywarren
Copy link
Member Author

jywarren commented Oct 24, 2018

@jywarren
Copy link
Member Author

OK, I've rebased this over the camera_web branch that includes the PiCam web software, and opened a separate PR for it to test. If it works, we could move over there (for a cleaner PR) or close that and merge it back in here, depending on what people want.

@jywarren
Copy link
Member Author

Wow, this worked:

screen shot 2018-10-26 at 4 07 59 pm

I'm super excited about this! Although I'm having trouble with the v2 NOIR camera.

Next - add a button to initiate this script and then do some tidying up in the Infragram repository...

@jywarren
Copy link
Member Author

OK! I'm closing in favor of the tidier #40 -- this is working! Infragram may need some tidying but otherwise this is good to go, and can be used as a template for doing the same with image-sequencer too!

@jywarren jywarren closed this Oct 28, 2018
@jywarren
Copy link
Member Author

jywarren commented Nov 1, 2018

@maykef i'm interested in learning more about CM 3 -- do you have a link? As to OpenCV, there are 2 approaches. First, this recipe uses OpenCV: #12

Second, we have a module in planning for image-sequencer that uses the cross-compiled OpenCV.js: publiclab/image-sequencer#237 -- this might be really interesting because it'd be so modular.

@maykef
Copy link

maykef commented Nov 1, 2018

Hey @jywarren I've been working like crazy on the camera. I think I've done most of the hardest part. The cameras trigger within half millisecond (thanks to using multiprocessing module).

Here is a nice pic I took a couple of days ago:

clip_raspicam
.
And here the almost simultaneous trigger:

multispectral_cam_sync

@jywarren
Copy link
Member Author

jywarren commented Nov 1, 2018 via email

@maykef
Copy link

maykef commented Nov 1, 2018

Are we running a Kickstarter campaign for this?

@jywarren
Copy link
Member Author

jywarren commented Nov 1, 2018 via email

@maykef
Copy link

maykef commented Nov 16, 2018

@jywarren Hey
I have finished with most of the work for the multispectral pi. What I want to do now is to run image-sequencer from a web browser accessed through an access point on the pi.
Image-sequencer should show the four images captured by the camera and then do all the processing

@jywarren
Copy link
Member Author

jywarren commented Nov 16, 2018 via email

@maykef
Copy link

maykef commented Nov 17, 2018

Hi @jywarren,

Have a look to the Raspicam repo
https://github.com/maykef/Raspicam

@jywarren
Copy link
Member Author

jywarren commented Nov 20, 2018 via email

@maykef
Copy link

maykef commented Nov 20, 2018

No worries.
These are the 4 bands. Camera one captures the R, G and B, while camera 2 collects the NIR band(845nm):
screenshot 2018-11-20 at 22 52 08

@jywarren
Copy link
Member Author

Oh, of course. Sorry, when i process, i usually have 3 bands in one image, and another in a second, so mentally i think of 2 images.

So you're accessing it with picamera.PiCamera(0) and picamera.PiCamera(1) -- we need to figure out how to fetch images from both cameras. I'll open a new issue for this!

@maykef
Copy link

maykef commented Nov 27, 2018

Apart from fetching the images, we need to think about image registration within Infragram. I've got an OpenCV script that already does the job, but the CM seems to run out of memory while doing the registration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants