Very basic question. I have managed to use RobotHub to run the example with events, mainly by cut and pasting code from the Luxonis GitHub to the code editor all works. I now want to work on this, but I have no idea how to save this example, so that I can source control my changes to it, other than manually copying and pasting into a file on my Mac. I am not very proficient in GitHub and don’t know VS Code, so it is probably a very basic issue, but not to me!
RobotHub app development basics
Hi KenMax
You could open a github repo and push the changes there. If the storage is not persistent, you can just clone it later, but I think RH has version control as well, so likely that won't be needed.
Do a git init
inside the vscode and then push.
Please tell me if that doesn't work so we can implement the functionality.
Thanks,
Jaka
Thanks for the help, but nothing seems to work! There is a commit option in the VSCode, but it fails, complaining about user.name and user.email not being set up. However, they seem to be set up in GitHub, and I can certainly commit from local repositories on my Mac. The log gives me:
git ls-files --stage -- /app/app.py [34ms]
2023-11-21 10:18:13.695 [info] > git ls-tree -l HEAD -- /app/app.py [77ms]
2023-11-21 10:18:13.695 [info] fatal: Not a valid object name HEAD
2023-11-21 10:18:13.700 [info] > git cat-file -s cb792ec32de6fe744a358f48e8f91fd3ce32d339 [6ms]
2023-11-21 10:18:13.702 [info] > git config --get commit.template [26ms]
2023-11-21 10:18:13.718 [info] No remotes found in the git config file.
2023-11-21 10:18:13.723 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/master refs/remotes/master [6ms]
2023-11-21 10:18:13.742 [info] > git status -z -uall [6ms]
But that means nothing to me. GitHub does seem to create a sort of project, with nothing in it, but telling me to create a new repository or push an existing repository. However, even the instructions they give don't seem to work for me, as they require me to use my GitHub user id and password, and then tell me that passwords are not supported!
KenMax However, even the instructions they give don't seem to work for me, as they require me to use my GitHub user id and password, and then tell me that passwords are not supported!
set your email/username in the config (user.name and user.email). Then go to your github account and create a new token under settings/tokens. Use that newly created token as the password when it asks for it.
Thanks,
Jaka
I found part of my confusion, as my target environment is a Raspberry Pi, but where I had previously had git set up was my Mac. However, this has not resolved my issue.
Using an SSH terminal to the Raspberry, I have added a user.name and user.email, which I can see with git config --list. A commit from the RobotHub VScode, still fails with no user.name or user.email. Using the RobotHub Web Terminal, git config --list shows nothing. If I run git config from within the Web Terminal it fails, because $HOME is not set. So, not really sure how to set up the user.email and user.name, so that it can be seen by VScode in RobotHub.
In the RobotHub Web Terminal, I have set $HOME (to /home/robothub), which has allowed me to configure email and name so that they now appear on a git config --list. However, VScode still fails with the same message and the log says I need to setup user.name and user.email, even though the Web Terminal shows them as set up.
@KenMax the RobotHub Studio (our custom VSCode)/ RobotHub Cloud doesn't support Git yet - if you create a Git repository there - it will get uploaded as part of our publishing step - which can have unintended consequences/fail
we are aware this is less than ideal - RobotHub currently has a simple application versioning (via the publish feature) - but no git support
customers who now use Git usually develop on their machine - then copy/paste to the RobotHub Studio and press run/publish as needed
Our aim is that soon, you will be able to develop directly on your Mac (or any other machine) - using the Raspberry Pi (or any other host) only as the target on which it runs. This is under development with no public ETA.
KenMax Web Terminal and the RobotHub Studio terminal are different environments
Web Terminal - runs directly on the host
RobotHub Studio - runs in a container defined by your application runtime
thus whatever you configure in Web Terminal - doesn't apply for RobotHub Studio