Setup Local Settings - theRAPTLab/gsgo GitHub Wiki
Most GEMSTEP default settings are stored in two places:
gsgo/gsgo-settings.js
gsgo/gs_packages/gem-srv/config/gem-settings.js
However, there are a number of local settings specific to a simulation server. These are stored in:
gs_packages/gem-srv/config/local-settings.json
The local-settings.json
is not stored in the repo and must be created and customized for each server. For example, you might have one local-settings.json file for the laptop running in your pilot classroom and a different local-settings.json file for the laptop you test and develop scripts with.
Currently there are two main settings that you'll probably want to modify:
-
MQTT_URL
-- The ip address of the Pozyx MQTT server. -
GS_ASSETS_PROJECT_ROOT
-- The default folder that GEMSTEP should look in for the list of projects and sprites.
Theoretically you can override any settings in gsgo-settings.js
and gem-settings.js
, but only do so if you know what you're doing. There may be unintended consequences.
(This requires a version of GEMSTEP after !171 -- October 15, 2021)
- If you haven't already done so, run
npm run gem
to create alocal-settings.json
file.npm run bootstrap; npm run start
- There should be a new
local-settings.json
file atgs_packages/gem-srv/config/local-settings.json
-
CTRL-C
to quit node.
- Edit
gs_packages/gem-srv/config/local-settings.json
and add a new entries.
NOTE this is a json file so:
- you cannot use javascript
//
comments. To add a comment just use a new obvious key, e.g."_MQTT_URL_COMMENT"
. The important key is"MQTT_URL"
, all other unknown keys are ignored. - both keys and values need to be wrapped in double quotes
- you need to add a comma after each item
Here's a full example. Note how I used extra entries to provide instructions and alternatives:
{
"_INFO": [
"Override constants defined gsgo-settings.js and gem-settings.js in this file",
"Settings added here can be set for your gsgo installation, and will not be",
"committed to the gsgo repo"
],
"GS_ASSETS_PROJECT_ROOT": "fallpilot",
"_GS_ASSETS_PROJECT_ROOT_COMMENT": "Load projects from /gs_assets/fallpilot rather than /gs_assets/local",
"MQTT_URL": "10.2.191.28",
"_MQTT_URL_COMMENT": "VU Lab",
"VU_MQTT_URL": "10.2.191.28",
"_VU_MQTT_URL_COMMENT": "VU Lab. To use this, replace MQTT_URL with this value.",
"REPLAY_MQTT_URL": "localhost"
"_REPLAY_MQTT_URL_COMMENT": "Local MQTT Server to replay streams. To use this, replace MQTT_URL with this value.",
You can also get away with just adding a single MQTT_URL
entry, but depending on who's managing the server it may not be as friendly:
{
"MQTT_URL": "10.2.191.28",
}
- Start node again with
npm run gem
- The app should start and connect to the server you specified. Look for this line in the terminal:
PTRACK 1883 MQTT Connect
PTRACK MQTT present
For more info on local settings, see !171