B4R Question RDC Arduino client -> Mysql server

alan dodd

Member
Licensed User
Longtime User
Hi Erel, I am successfully running RDC on > 30 concurrent android devices to query (write/read) remote mysql server on a windows machine via wifi.
I would like to write/read to same mysql server also from several arduinos with wifi or ethernet shield or maybe esp8266. Do you think it would be possible / and easy to port?
Thanks, Alan
 

alan dodd

Member
Licensed User
Longtime User
1) oops.. Quite right:rolleyes:

2) No, I'm using just RDC, with mysql-connector-java, running it as a service with yajsw as a wrapper. Never had a single hickup.
Would I be better off with jRDC2 on Arduinos?
 
Upvote 0

alan dodd

Member
Licensed User
Longtime User
I thought so.
To be able to write the custom handler i need to know the protocol involved in sending and receiving messages between client and jrdc server. Where can I find the specs?
Thanks
 
Upvote 0

alan dodd

Member
Licensed User
Longtime User
jRDC server and the clients are open source. However you don't need it.


You need to create a simple handler and send a http request from the Arduino.
Or create a WebSocket handler and use rWebSocketClient to connect to the server.

Sorry, I don't understand.
Whay I need is to write and read records (sql statements) to a mysql db hosted on a windows pc from some 10 arduinos with ethernet.
You tell me that I cannot use rdcconnector because it is difficult to implement on arduino.
And that I do not need the server jrdc?
I find it very useful to have a config.properties file with all the statements I need predefined on the server, and then just send the request from the client to the server for the proper statement together with the relevant data, and then wait for the reply.
So: can this be done from arduino or not?
From Arduino should I then send a http request to a http server on the pc hosting mysql, made maybe with B4J?
Where can I find an example? Do I need to build a program from scratch on the server to do something similar to what jRDC server does? Without using serializator?
I am a bit confused...
Alan
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

alan dodd

Member
Licensed User
Longtime User
jRDC is a B4J server program. You need to learn how B4J server programs are built. Overall it is quite simple.

You can use jRDC and add a new handler for the Arduino requests or not use jRDC at all.

Start with the hello world example: https://www.b4x.com/android/forum/threads/server-building-web-servers-with-b4j.37172/
The next step is to understand how jRDC interacts with the database.

I more or less understand how jRDC works, already tested how to interact with mysql from b4j.
BUT HOW do I build the requests to the server from arduino client?? I know how to build them with b4a, but b4r?? No rdcconnector. So what?
Cheers
 
Upvote 0

alan dodd

Member
Licensed User
Longtime User
BTW, I would have used MQTT for such a solution instead of HTTP (assuming that it is in the local network). You can still implement the server with B4J.
I'll have a look at MQTT. But I would prefer to use RDC, as it is already used to access the same db from android clients. It seems messy having two different java services running on the same server accessing same db for different clients. I'll have a look. Thanks.
 
Upvote 0
Top