Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kWebActiveMQHostAddress IP address and golfsim monitor #40

Open
jeshernandez opened this issue Jan 3, 2025 · 6 comments
Open

kWebActiveMQHostAddress IP address and golfsim monitor #40

jeshernandez opened this issue Jan 3, 2025 · 6 comments
Assignees

Comments

@jeshernandez
Copy link
Contributor

Just need to update documentation that we also need to change the IP address in the following location:

MonitorServlet.java line #559 private static String 55 = "tcp://10.0.0.:61616";

Unless I missed a step. I updated the JSON file and it was looking for 10.0.0.41:61616 in the tomcat page. After updating to my IP address where ActiveMQ is running. I refreshed using the shell script, re-build using mvn package and now it works.

@jeshernandez
Copy link
Contributor Author

While I was there, I also updated where the IP address appeared in the C++ code as well and will re-compile.

@benhalpern
Copy link
Contributor

I ran into the same confusion and sounds like I went on the same journey and got it worked out without noticing this issue. 😄

If golf_sim_config.json needs to be updated by the individual, it should probably use env vars or some other personalization functionality for values that are customizable down to the individual, eh?

@jeshernandez
Copy link
Contributor Author

Yea, should be simple enough. Just having the code base read from either env or even still the json file is ideal--instead of using string literal values for IP values. As long as those who are working with the code are able to resolve for now :D

@jamespilgrim jamespilgrim self-assigned this Jan 9, 2025
@jamespilgrim
Copy link
Owner

Agreed - you all make a good point. Let's put the IP addresses in environment variables. Those are naturally setup in a user-specific way, such as in .zshrc or .bashrc, or whatever-it-is-.rc :) They don't change often, so set them there, and you shouldn't have to touch 'em again for a long time.

As far as reading those values, we could then just read 'em directly in the code (getenv()). But, I wonder if it would be more flexible to instead use those environment variables as input to command-line parameters. So, like
pitrac_lm --web_apps_ip $PITRAC_PI2_ADDRESS --e6_connect_ip $PITRAC_E6_ADDRESS --system_mode camera1 ... etc. .

That way, if you want to do something more complicated than environment variable, you could do so in the script. What do you all think? And how many env variables? The E6 port shouldn't change frequently, so maybe leave that in the .json configuration file?

@jeshernandez
Copy link
Contributor Author

@jamespilgrim seems like a great idea.

@jeshernandez
Copy link
Contributor Author

jeshernandez commented Jan 10, 2025

@jamespilgrim I finished this on the Java side by the way. Still testing better logging and also waiting for the existing PR to be merged to push PR after I am done. jeshernandez/PiTrac@main...jeshernandez:PiTrac:feature/java-refactor-phase-one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants