B4J Question JRDC2 server IP Address

AKJammer

Active Member
Licensed User
Longtime User
I'm using JRDC2 to query MariaDB from android tablets. This is working quite well with one exception. The Linux DB server runs on the local network and I've got it set to always have an IP address of xxx.xxx.xxx.222. On the tablets, I find the tablets IP address, then use their subnet address and add the .222 in order to "find" the database connection. This works for now, but it's pretty kludgy. If my server goes down and I switch to a backup, which I have running on a Windows machine, I'd have to reconfigure the network in order for it to work. I'd like it to be a bit more dynamic, either using a configuration file, or some other method to determine the IP address of the database server.

Has anyone come up with a method to do this? Or any ideas on what I might try?

Thanks,
Jim
 
Solution
That's kind of what I wanted to do, but I would still need the IP of the server to get the config file from in the first place. But, I think I've found a solution.
I'm defaulting the IP to the tablets subnet with .222 tacked to the end, that's going to be my default. If it fails on connect though, I'm bringing up another layout that will just ask them for the IP address of the server. The judges only run the tablets, they don't get them booted up and ready to go, that'll be my scoring team. So I'll be able to manage it that way. Thanks for the thoughts, I really do appreciate having someone to bounce stuff off of.

Merry Christmas!

Jim

aeric

Expert
Licensed User
Longtime User
Try:
 
Upvote 0

AKJammer

Active Member
Licensed User
Longtime User
Thanks, this worked out for scanning for IP's, but determining whose running JRDC2 didn't work out. Running a JRDC2 test (http://foundIP:17178/test) took about 15-20 seconds per IP to time out, which would take way too long. Maybe I could reserve xxx.xxx.xxx.005 through 010 for my DB servers and only scan those addresses to see if a DB was available. Put the main DB on 005 and just roll through to the others if 005 wasn't available. Still a bit kludgy, especially if I set up into an unknown environment where I can't control the IP allocations. This is for a dance competition judging system where I'll be setting up in various hotels or ballrooms. Normally I'll bring my own mesh network, but can't guarantee that.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
I am not sure I understand what you are trying to do.
Are you looking for an easy way for changing the jRDC2 server IP in every tablet running B4A?
One way I can think is
1. save a config file in a cloud storage that can be access by the B4A app
2. the B4A app will read the server IP from this config file and save it
3. if the server IP has changed, you need to update the config file
 
Upvote 0

AKJammer

Active Member
Licensed User
Longtime User
That's kind of what I wanted to do, but I would still need the IP of the server to get the config file from in the first place. But, I think I've found a solution.
I'm defaulting the IP to the tablets subnet with .222 tacked to the end, that's going to be my default. If it fails on connect though, I'm bringing up another layout that will just ask them for the IP address of the server. The judges only run the tablets, they don't get them booted up and ready to go, that'll be my scoring team. So I'll be able to manage it that way. Thanks for the thoughts, I really do appreciate having someone to bounce stuff off of.

Merry Christmas!

Jim
 
Upvote 0
Solution
Top