Arduino Due and ProtoBuf: Where to start?

507 views
Skip to first unread message

dgelman

unread,
Feb 25, 2015, 3:05:21 PM2/25/15
to nan...@googlegroups.com
Hello Community,

I was provided a test software program that transfers data between a server and client via protobuf. The current implementation, both the server and client is running on my local PC. This was developed in C# using Visual Studio. In addition, the server may generate a .proto file in c++, which (I have been told) describes the incoming data to the device where the .proto file is housed in. Please correct me if I am mistaken, protobuf is completely new to me. 

I would like to replace the client PC with an Arduino Due (w/ an Ethernet Shield), which lead me to nanopb. I am very confused about the .proto file, how to start, and what needs to be done in order for the Due to acquire the data coming from the server. I have years of experiences with the microcontroller.

Any help would be appreciative.

I am using Visual Micro (Arduino IDE plugin for Visual Studio) as my programming environment. My hardware includes an Arduino Due with an Ethernet shield.  

Thank you,
Daniel 

Petteri Aimonen

unread,
Feb 26, 2015, 1:21:04 AM2/26/15
to nan...@googlegroups.com
Hi,

> I would like to replace the client PC with an Arduino Due (w/ an Ethernet
> Shield), which lead me to nanopb. I am very confused about the .proto file,
> how to start, and what needs to be done in order for the Due to acquire the
> data coming from the server.

Let's start with the .proto file. Download the nanopb binary package for
your operating system. Then run this command:

...path to nanopb.../generator-bin/protoc --nanopb_out=. whatever.proto

This should give you two files, whatever.pb.h and whatever.pb.c, which
you can include in your project. Take a look at whatever.pb.h, it has
the C structures you can use for your messages.

Then take a look at examples/simple. Perhaps even get that running on
your Arduino before modifying it. It will show the basic way to encode
and decode messages.

--
Petteri
Reply all
Reply to author
Forward
0 new messages