Rosserial tool-avrdude build failing with not-matching SHA?


#1

Hi, I left an issue on the openag_brain_docker_rpi codeset but it looks like something has died in the docker setup. Since I’m doing most of my work using that setup, I’m down too.

Is anybody else seeing the following error during rosrun openag_brain flash?

Initializing PlatformIO project
OpenAg firmware project initialized!
Warning: no modules specified for the project
Downloading "rosserial_arduino_libs"
Cloning into '/tmp/tmp1wKTb1/lib/rosserial_arduino_libs'...
remote: Counting objects: 313, done.        
remote: Total 313 (delta 0), reused 0 (delta 0), pack-reused 313        
Receiving objects: 100% (313/313), 134.99 KiB | 0 bytes/s, done.
Resolving deltas: 100% (198/198), done.
Checking connectivity... done.
[Mon Apr 24 22:51:46 2017] Processing megaatmega2560 (platform: atmelavr, board: megaatmega2560, framework: arduino)
---------------------------------------------------------------------------------------------------------
Installing framework-arduinoavr package:
Already installed
Installing tool-avrdude package:
Downloading  [####################################]  100%          
Error: The 'sha1' sum '1c4eab065c4aafb594737d619df02c907e57286e' of downloaded file 'tool-avrdude-linux_armv6l-1.60001.1.tar.gz' is not equal to remote '1a5349907a5ebc7f12b8205d714855e3e810cd47'
Error: Compilation failed
Done

@gordonb @wsnook @rbaynes ?

Help is definitely appreciated. :slight_smile:

J


#2

I haven’t been running openag_brain for some time, but your console log has a couple suggestive lines:

sounds like maybe you’re missing the fixture stuff to specify which firmware modules are needed.

And,

sounds vaguely like times when apt-get is mad about its package index being out of date. I’m not familiar with installing packages inside of docker, but maybe you could try manually installing avr-dude with something like

sudo apt-get update && sudo apt-get install avr-dude

It’s also possible that the problem is that something is trying to use a sha1 hash instead of sha256. I’m not sure if that would be coming from configuration in the docker image. It might be from whatever package repository it’s trying to talk to. Here are a couple links for threads about package checksum problems with docker:


#3

That was a good clue. I am confused about the difference between the launch/yaml files and the CouchDB. I had thought that I didn’t need to install the fixtures/firmware into the DB if I used the launch file. Not so. To install firmware, you MUST have records in firmware_module and firmware_module_type. So I modified the Default.json file to include a subset I needed for the PFC1. Ran the import script and now that message is replaced by the downloading of the repos for the desired firmware_module(s). Yay!

This one is killing me. KILLING ME!

So I got desperate and typed: platformio upgrade

pi@0466dacf13b3:~$ rosrun openag_brain flash       
Initializing PlatformIO project
OpenAg firmware project initialized!
Parsing firmware module type "air_flush" from server
Parsing firmware module type "binary_actuator" from server
Parsing firmware module type "dht22" from server
Parsing firmware module type "pulse_actuator" from server
Parsing firmware module "dht22_1" from server
Downloading "openag_firmware_module"
Cloning into '/tmp/tmpSeJ9XP/lib/openag_firmware_module'...
remote: Counting objects: 43, done.        
remote: Total 43 (delta 0), reused 0 (delta 0), pack-reused 43        
Unpacking objects: 100% (43/43), done.
Checking connectivity... done.
Downloading "rosserial_arduino_libs"
Cloning into '/tmp/tmpSeJ9XP/lib/rosserial_arduino_libs'...
remote: Counting objects: 313, done.        
remote: Total 313 (delta 0), reused 0 (delta 0), pack-reused 313        
Receiving objects: 100% (313/313), 134.99 KiB | 0 bytes/s, done.
Resolving deltas: 100% (198/198), done.
Checking connectivity... done.
Downloading "openag_dht22"
Cloning into '/tmp/tmpSeJ9XP/lib/openag_dht22'...
remote: Counting objects: 38, done.        
remote: Total 38 (delta 0), reused 0 (delta 0), pack-reused 38        
Unpacking objects: 100% (38/38), done.
Checking connectivity... done.
[Tue Apr 25 03:58:23 2017] Processing megaatmega2560 (platform: atmelavr, board: megaatmega2560, framework: arduino)
---------------------------------------------------------------------------------------------------------
PackageManager: Installing framework-arduinoavr @ ~1.10617.4
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
PackageManager: Installing tool-avrdude @ ~1.60300.0
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%
CorePackageManager: Installing tool-scons @ ~3.20501.2
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%
tool-scons @ 3.20501.2 has been successfully installed!
Verbose mode can be enabled via `-v, --verbose` option
Converting src.ino
Collected 31 compatible libraries
Looking for dependencies...
Library Dependency Graph
|-- <openag_dht22>
|   |-- <openag_module>
|   |-- <rosserial_arduino>
|-- <rosserial_arduino>
Compiling .pioenvs/megaatmega2560/src/src.ino.o
Archiving .pioenvs/megaatmega2560/libFrameworkArduinoVariant.a
Compiling .pioenvs/megaatmega2560/FrameworkArduino/CDC.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/HardwareSerial.o
Indexing .pioenvs/megaatmega2560/libFrameworkArduinoVariant.a
In file included from lib/rosserial_arduino_libs/ros.h:38:0,
from /tmp/tmpSeJ9XP/src/src.ino:4:
lib/rosserial_arduino_libs/ros/node_handle.h: In instantiation of 'int ros::NodeHandle_<Hardware, MAX_SUBSCRIBERS, MAX_PUBLISHERS, INPUT_SIZE, OUTPUT_SIZE>::publish(int, const ros::Msg*) [with Hardware = ArduinoHardware; int MAX_SUBSCRIBERS = 25; int MAX_PUBLISHERS = 25; int INPUT_SIZE = 512; int OUTPUT_SIZE = 512]':
lib/rosserial_arduino_libs/ros/node_handle.h:297:39:   required from 'void ros::NodeHandle_<Hardware, MAX_SUBSCRIBERS, MAX_PUBLISHERS, INPUT_SIZE, OUTPUT_SIZE>::requestSyncTime() [with Hardware = ArduinoHardware; int MAX_SUBSCRIBERS = 25; int MAX_PUBLISHERS = 25; int INPUT_SIZE = 512; int OUTPUT_SIZE = 512]'
lib/rosserial_arduino_libs/ros/node_handle.h:227:35:   required from 'int ros::NodeHandle_<Hardware, MAX_SUBSCRIBERS, MAX_PUBLISHERS, INPUT_SIZE, OUTPUT_SIZE>::spinOnce() [with Hardware = ArduinoHardware; int MAX_SUBSCRIBERS = 25; int MAX_PUBLISHERS = 25; int INPUT_SIZE = 512; int OUTPUT_SIZE = 512]'
/tmp/tmpSeJ9XP/src/src.ino:37:15:   required from here
lib/rosserial_arduino_libs/ros/node_handle.h:441:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i =5; i<l+7; i++)
^
Compiling .pioenvs/megaatmega2560/FrameworkArduino/HardwareSerial0.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/HardwareSerial1.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/HardwareSerial2.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/HardwareSerial3.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/IPAddress.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/PluggableUSB.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/Print.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/Stream.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/Tone.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/USBCore.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/WInterrupts.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/WMath.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/WString.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/_wiring_pulse.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/abi.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/hooks.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/main.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/new.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/wiring.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/wiring_analog.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/wiring_digital.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/wiring_pulse.o
Compiling .pioenvs/megaatmega2560/FrameworkArduino/wiring_shift.o
Archiving .pioenvs/megaatmega2560/lib/libopenag_firmware_module.a
Compiling .pioenvs/megaatmega2560/lib/rosserial_arduino_libs/duration.o
Compiling .pioenvs/megaatmega2560/lib/rosserial_arduino_libs/time.o
Indexing .pioenvs/megaatmega2560/lib/libopenag_firmware_module.a
Archiving .pioenvs/megaatmega2560/libFrameworkArduino.a
Compiling .pioenvs/megaatmega2560/lib/openag_dht22/openag_dht22.o
Archiving .pioenvs/megaatmega2560/lib/librosserial_arduino_libs.a
Indexing .pioenvs/megaatmega2560/libFrameworkArduino.a
Indexing .pioenvs/megaatmega2560/lib/librosserial_arduino_libs.a
Archiving .pioenvs/megaatmega2560/lib/libopenag_dht22.a
Indexing .pioenvs/megaatmega2560/lib/libopenag_dht22.a
Linking .pioenvs/megaatmega2560/firmware.elf
Checking program size
text	   data	    bss	    dec	    hex	filename
12692	    792	   1474	  14958	   3a6e	.pioenvs/megaatmega2560/firmware.elf
Building .pioenvs/megaatmega2560/firmware.hex
Looking for upload port...

Warning! Please install `99-platformio-udev.rules` and check that your board's PID and VID are listed in the rules.
https://raw.githubusercontent.com/platformio/platformio/develop/scripts/99-platformio-udev.rules
Auto-detected: /dev/ttyACM0
Uploading .pioenvs/megaatmega2560/firmware.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: reading input file ".pioenvs/megaatmega2560/firmware.hex"
avrdude: writing flash (13484 bytes):

Writing | ########################avrdude: stk500v2_ReceiveMessage(): timeout
#########################avrdude: stk500v2_ReceiveMessage(): timeout
# | 100% 12.40s

avrdude: 13484 bytes of flash written
avrdude: verifying flash memory against .pioenvs/megaatmega2560/firmware.hex:
avrdude: load data flash data from input file .pioenvs/megaatmega2560/firmware.hex:
avrdude: input file .pioenvs/megaatmega2560/firmware.hex contains 13484 bytes
avrdude: reading on-chip flash data:
...

So. Yay! I’m back up. What a ride! haha.


V2 Food Computer Kit Build
#4

Could you please clarify how you did this? I am getting the same error currently and would really appreciate your help.

Peter.


#5

@Webb.Peter are you using the docker container or the global install? I had to ditch the docker container as it’s not ready for primetime yet.

The global install works well tho. I’ve posted a complete install list here: Need help setting up the development environment? - scroll to the bottom. It includes links to a repo of all of the PFC1 config files I’ve created including the pfc1 version of default.json

This approach is nice because the openag_brain service is not running and stealing the usb connection to the Arduino.
The command you want is:

rosrun openag_brain firmware -t upload /home/pi/catkin_ws/src/openag_brain/launch/pfc1.yaml -p ros

If you need the pfc2 yaml file, just change the name of the file above.

I hope this helps!

J


#6

Oh also if the error you’re getting is the checksum failure. In the command prompt type:

platformio upgrade

and it will upgrade your platformio software and the error will go away. :slight_smile:

cheers,

J


#7

@juhnke @Webb.Peter The new global install script should be fairly stable, as long as you have enough swap RAM.We’ve essentially done platformio upgrade by changing the dependency we rely on to platformio 3 instead of 2, which we were using before. It seems like the repositories for the binaries in platformio used the same URL and upgraded to platformio 3… :grimacing:

We’re working on some of the USB problems and I’m personally working on the Serial communications between Arduino and RPi.


#8

Tried all sorts of combinations after exploring the file structure looking for the file.

Fair warning: I am trying to do this right now from a .img that Jake provided me with from April in the media lab. I think I need to start over and do a clean install instead of trying to do it from the kit at all. I’ll post a screenshot from the PFC, perhaps I’m missing something very obvious.

I appreciate the help so far, any other pointers will be very appreciated.


#9

HMM. Do this:

cd ~/catkin_ws/src/openag_brain/

Pull the newest repo down with this:

git pull origin master

Then rebuild (takes a long time) with this:

./scripts/install_dev

Here are few more commands to round out the upgrade:

source ~/catkin_ws/devel_isolated/setup.bash
openag db init

I am not sure if you need to upload to the DB to flash the arduino so try this:

rosrun openag_brain firmware -t upload /home/pi/catkin_ws/src/openag_brain/launch/personal_food_computer_v2.yaml -p ros

If you have success, yay! If not we’ll need to figure out how to get a yaml file into the couchdb as the json file is no longer included in the repo.

Let me know how it goes.

J


V2 Food Computer Kit Build
日本語でOpenAgについて語るスレ
#10

First of all, I want to thank you for your prompt/detailed responses, they are invaluable. I have been out of town this weekend so I’m just now getting back in front of the PFC. I was running the rebuild when I got this error, thoughts?


#11

@juhnke, @Webb.Peter, @gordonb

A slight variation on the theme. Seeing the same error with a docker install.
I tried the

platformio update

but it failed, and said to run this

sudo pip install -U platformio

after that, flash worked. It takes patience as it rebuilds the tools. I noticed that while running it says:

Warning: no modules specified for the project

Is there somewhere that the default sensor configuration is specified?


#12

What command did you use to flash the arduino?

The .yaml file referenced in the flash command above specifies the modules. You may also need to upload to the DB.

Here is the full install list I use for PFC1. THere’s a flash db command. You’ll need to choose the default.json file that corresponds to your build.


#13

I just ran:

rosrun openag_brain flash

No yaml file was specified, so I assumed it was using a default file (location?)

I thought with the new version that fixtures were no longer in the DB (or at least not needed there by flash). The inclusion in the DB was for data consistency, since flash used the yaml and they had the step of building the yaml from the DB before flash would run. I actually preferred them in the DB.


#14

Ok ya you need to add the config file in the command string. For PFC2 that would be:

rosrun openag_brain firmware -t upload /home/pi/catkin_ws/src/openag_brain/launch/personal_food_computer_v2.yaml -p ros

I preferred it as well and now we’re in this weird overlap state where some is in the db (recipes) and some isn’t. They dev team is also working at removing the Arduino from the stack which pulls me out of the supported platform as I have two units with Arduinos bolted to them. I’m not sure what’s driving the changes. I’m sure they have good reasons and since the lighting and chiller aren’t real for PFC2 they aren’t rushing to build a stable deployment. Maybe. Again speculation.

Things to know: (possible rant)

  1. Docker repo doesn’t work on anything but especially PFC1
  2. Openag_brain doesn’t work on anything unless you detach head back to a prior state because of active recipe refactoring etc
  3. Arduinos are going away
  4. Rosserial is being replace by a bespoke serial connector requiring new driver development for software outside PFC1
  5. I’m going to replace all of the DWC sensors that were spec’d in PFC1 to PFC2 hardware because the first gen sensors suck and it will be easier to track with the dev team.

Cheers,

J


Arduino_handler: serial_connection.readline() broken
External Fogponic system design
Looking For Basic Help Starting Up Food Computer 2.0
#15

@juhnke
Thanks, Other than trying to help @Webb.Peter get his V2 up and running, I am leaving the PFC alone.

My focus is on the MVP, which at this stage is all Raspberry and (almost) all Python. My MVP brain is happily chugging away, complete with a recent addition of CouchDB logging.

It should probably be a separate thread, but your thoughts on the UI, and how to integrate sensor data from the MVP would be appreciated.


#16

:grimacing: We apologize that we haven’t been super transparent about this decision…

There were problems in the rosserial library which we were using to communicate with the Arduino, so we’ve been working on getting the PFC2 hardware fully functional in a stable manner. Not being able to provide meaningful debug information from the Arduino (Usually it would just say “Disconnected from Arduino”) was a major roadblock to any new developments.

We made an Arduino sketch which gets version controlled so we can debug it more, and a serial protocol to replace rosserial. It’s more stable than rosserial, so we will probably push this once it is ready.

We’re moving away from Arduino because these problems of communicating between RPi and Arduino are starting to be a bottleneck for us, and we want to go towards a more decentralized architecture. We’ve prototyped a “Brain Box” which is basically the PFC2 brain module without an Arduino, controlled via python nodes. This has been pretty successful for us and we’ve used it in the “Fermentabot”.

The codegen allowed us to provide flexible hardware configurations, given that it all ran on an Arduino, but we’re trying to restructure it to be more hardware agnostic so we can use USB devices in a way that’s not considered an exception.

I do agree that moving the hardware configuration out of the database and into code reduces portability of the data a bit, but the recipe should be written in a way that assumes the system(software config+hardware) is capable of abstracting over things and that responsibility would go towards the device driver and firmware coders.

In the Brain Box each sensor is its own ROS node, making it easier to pick and choose which sensors to use or not in the launchfile. It’s a bit messy right now the way we’re pushing these changes, but it should make it easier to add future changes and make the openag_brain less hardware dependent than it is right now.


V2 Food Computer Kit Build
#17

@spaghet given that you are considering overhauling the architecture in this way, would you also consider ways to support 100% free alternatives to the Raspberry Pi? While the Pi does run Linux, there is a binary blob required to boot it. Developing on one of the alternatives, or at least having an architecture that is flexible enough for people to use alternatives would be desirable.


#18

I think if we do use the Raspberry Pi, we’ll be sticking with Raspbian. It has the biggest community support inside the RPi community and will be the easiest OS to work with for people who use RPi. If we end up with another Single Board Linux device, we might look to some FLOSS OSes.

Also, if I’m not mistaken the source code for Raspbian is open source. https://github.com/raspberrypi/linux
https://raspberrypi.stackexchange.com/questions/48223/where-can-i-find-the-source-code-of-raspbian-jessie

If this isn’t what you meant, please feel free to correct me.


#19

Raspbian is free/open source software

However, to run Raspbian on a Raspberry Pi, you need to have that binary firmware blob too.

Some of the similar boards in that list will also run Debian or Raspbian, so unless you hard-code something that is very specific to Raspberry Pi, it should be feasible to interchange them.

Maybe it is worthwhile asking on the FreedomBox list or the Debian ARM list to get suggestions about the strategy?


#20

There is now a thread about this on debian-arm