I've successfully used nanopb on a raspberry pi for a couple of months. Now I changed hardware to the NVIDIA TX1 and I have some problems generating pb files.
This is the commando I've used all the time:
protoc --plugin=protoc-gen-nanopb=Protobuf/nanopb-master/generator/protoc-gen-nanopb --nanopb_out=. RobotCmdData.proto
On the raspberry pi this generates the pb files successfully, but on the NVIDIA TX1 I get the following error:
Protobuf/nanopb-master/generator/protoc-gen-nanopb: program not found or is not executable
--nanopb_out: protoc-gen-nanopb: PLugin failed with status code 1
However, when running ls -la the file is found and is executable
ls -la Protobuf/nanopb-master/generator/protoc-gen-nanopb
-rwxr-xr-x 1 ubuntu ubuntu 480 Apr 19 13:04 Protobuf/nanopb-master/generator/protoc-gen-nanopb (in green text)
I also tried to give the absolute path, but I receive the same error. Does anyone have an idea of what causing the error?
Best regards
Sondre
Thank you for your quick response!
> Does the generator work when run separately outside protoc? Like:
> python nanopb/generator/nanopb_generator.py
python Protobuf/nanopb-master/generator/nanopb_generator.py
Usage: nanopb_generator.py [options] file.pb ...
Options:
-h, --help show this help message and exit
-x FILE Exclude file from generated #include list.
-e EXTENSION, --extension=EXTENSION
Set extension to use instead of '.pb' for generated
files. [default: .pb]
-f FILE, --options-file=FILE
Set name of a separate generator options file.
-I DIR, --options-path=DIR
Search for .options files additionally in this path
-D OUTPUTDIR, --output-dir=OUTPUTDIR
Output directory of .pb.h and .pb.c files
-Q FORMAT, --generated-include-format=FORMAT
Set format string to use for including other .pb.h
files. [default: #include "%s" ]
-L FORMAT, --library-include-format=FORMAT
Set format string to use for including the nanopb pb.h
header. [default: #include <%s> ]
-T, --no-timestamp Don't add timestamp to .pb.h and .pb.c preambles
-q, --quiet Don't print anything except errors.
-v, --verbose Print more information.
-s OPTION:VALUE Set generator option (max_size, max_count etc.).
Compile file.pb from file.proto by: 'protoc -ofile.pb file.proto'. Output will
be written to file.pb.h and file.pb.c.
> What about this one, it should say "DecodeError: Truncated message":
> echo | generator/protoc-gen-nanopb
echo | Protobuf/nanopb-master/generator/protoc-gen-nanopb
bash: Protobuf/nanopb-master/generator/protoc-gen-nanopb: /bin/sh^M: bad interpreter: No such file or directory
Sondre
Thank you so much, Petteri :)
Best regards
Sondre