Setting up dev / testing environment - Mac?

Has anyone successfully set up a dev environment complete with emulation on the Mac? Does anyone have any instructions or links perhaps that might help?

Are You volunteeringā€¦? :smiley:

Thereā€™s much to do.

Development platforms are probably an area of great variance, I muck around on a couple of Raspberry Piā€™s but mostly on a battered old xubuntu laptop 32 bit PC with a lousy ā€˜kā€™ key .
I tend to do what work Iā€™ve done on zynthian using idle.

Iā€™ve had the gui and webconf running as an entity on the PC but not got the engines chugging.
I seem to remember that the JoFe uses a linux PC
I donā€™t see any problems with the mac but Iā€™d stick it in a vm . . .

If I was to suggest a preferred IDE Iā€™d say pycharm but others will have alternatives.

The release cycle is being heavily addressed and it looks lie that has ā€˜tractionā€™ . ā€¦

Itā€™s really down to what you would lie to be involved in developing.
Obviously any help is welcome.

1 Like

I do intend to volunteer if I can find things that I can do to contribute. But, I have to follow the proper steps:

PHASE 1: Set up dev environment.
PHASE 2: ?
PHASE 3: Profit

:grinning:

Seriously, though, Iā€™ve heard of PyCharm and read a bit about it and that looks like it would be the one I would want to go with. Thanks for that.

Iā€™m also confused on how to run/emulate the code on a non-Rpi machine for testing purposes. I donā€™t mind running Linux under a VM if necessary, but Iā€™ve read that that isnā€™t necessary.

Iā€™ve read about QEMU, but I havenā€™t been able to get it to work successfully. Iā€™m completely new to Rpi development and I see conflicting and outdated information on how to set it up. My Zynthian is built on an Rpi 3 B+, so ideally, I need to be able to emulate that particular board.

Ideally, Iā€™d also like to be able to edit/run/test code off a microSD card, which I can then pop into the Zynthian. (I have extFS for Mac to be able to read/write to them.)

Any further assistance is appreciated!

I only run the webconf on a Linux machine.
No ide but atomā€¦
And zynthian-ui directly on the raspi with vi.

Atom is pretty great! I use that, too.

So Iā€™ve been working with PyCharm. Bit of a learning curve, but I think I really like it! Makes it easy to integrate with GitHub, which Iā€™m still getting used to (been a long time since Iā€™ve used VCS). But, it also allows you to easily deplpoy the changes to the Zynthian as you work. Itā€™s the closest that Iā€™ve been able to come to live coding/testing.

Glad you like it. Itā€™s VERY powerful.

Could you draw a block diagram of how you connect it?
I would like to write up a ā€˜standardā€™ development environment and such an example would help that process?

I would be happy to. Iā€™m not sure what a block diagram would look like for this type of thing. Do you have an example you could point me to?

image

It may seem simplistic but it helps break down what people have configured.

How is this? Let me know if you need anything other information or would like any changes.

Block%20Diagram

Thanks Iā€™ve been looking at PyCharm working with online debugging using remote Interpreters and can confirm that running the tornado based zynthian-weboconf, works fine onto a remote Raspbeery Pi.

It builds a tmp directory under the zynthian-webconf/ directory with a unique identifier . . .
And runs quite well, allowing a full debug environment.
Very satisfying.

I have the settings and will write it up in the wiki if itā€™s of any use to anyone.
The mappings from the development machine to the raspberry pi is probably the main area to standardise in this environment which is the kind of thing I want to put into the flow diagrams.

Because the zynthian software exists across several different repositories iā€™, not sure, yet, how this could be set up in the PyCharm environment.
Iā€™m going to try different zynthian components ( zyncoder, zynthian-webconf, etc ā€¦ ) opened in different PyCharm projects.

That is exactly what Iā€™ve been trying to accomplish. Itā€™s slow-going because Iā€™m new to Pi development.

What I have done (hopefully this will work for you) is this:

  1. Create a new, blank PyCharm project. Call it Zynthian.
  2. Go to VCS->Checkout from Version Control->Git.
  3. Use the GitHub URL for the given ā€œrepositorynameā€ and use the directory PyCharmProjects/Zynthian/repositoryname.
  4. When you Click Clone, it will ask you ā€œWould you like to open the directory ā€¦/PyCharmProjects/Zynthian/repositoryname?ā€ Click Yes.
  5. Then it will ask you ā€œHow would you like to open the project?ā€ Select ā€œOpen in current windowā€ and check ā€œAdd to currently opened projectsā€.
  6. When you click ā€œOkayā€ it will add it as a sub-project to Zynthian. You will see it in Bold letters. If it is not bolded, something went wrong somehwere.
  7. Go into Settings->Version Control->Ignored Files. Make sure to add repositoryname/.idea folder to the list.
  8. If you go to Settings->Version Control, you should see a list of all repositories that have been added and they all should say ā€œGitā€.

So, for example, my setup (so far) looks like this (note that docs is not bold because it is not a GitHub folder):

  1. If you havenā€™t already, go to Tools->Deployment->Configuration. Set it up like this:

  1. You can then set up the mappings between the projects and the Zynthian directories in the same dialog:

This is what I have so far. I would LOVE to be able to debug remotely or run an emulation locally. I just havenā€™t been able to get any of that to work.

Thatā€™s fantastic!
The trick with the remote debug is to define a remote Interpreter.

The Little cog wheel has a Show All option which is a bit non intuitive and is often used during the initial confusions.
However we want the Add Menu Option.

Which gives us

Select the ssh option . . .


and fill all that in . . .

and that. . . .

**AND THEN SET THE INTERPRETER TO python3 in the following **

Hey Presto All the code loaded on the remote pi !!

It strike me that using a Raspberry Pi as a development environment would seem to a lot less involved than using an emulation.

1 Like

Oh, cool! Iā€™ll definitely give it a try!

You are right that it would be less involved than emulation. I think with what I have done so far, I can be productive, but this is even better. This gives me pretty much what I was looking for and is easier to set up!

Thanks!

Ok Built a similar structureā€¦
image

But getting

Unregistered VCS root detected, message

Do You get the same? I presume itā€™s the symbolic links in zynthian-ui to zyncoder & data.

Yes, those are the symlinks. I saw that, too. I believe that dialog should only be relevant for the interaction with GutHub and shouldnā€™t affect any dev or deployment activities. You should be able to ignore them and leave them as-is.

In a perfect world should we fork the zynthian repos into our own fork?

Yes. Iā€™m new to GitHub, but from what I have read, that is how it is preferred to be done unless you are on the core development team. I have forked all Zynthian repositories to my own account. Then, I can edit/commit at will. Once you have something to contribute, then you issue a pull request, which asks the Zynthian project to incorporate changes (or even just parts of changes) into the main project.

Unfortunately this feature is only available in the professional version

Yes, It is a pain but to work in the modern environments effectively the sort of complexity offered is what is required. They do seem to relenting on their recent rather aggressive approach to pricing. Itā€™s Ā£150.00 for the first year and decreases after that, althouā€™ they have,as I say, mucked around with the pricing model before. However when all said and done the obvious alternative is Eclipse (Other suggestions appreciated, I know there are others people speak of atom but Iā€™ve not looked because for better or worse I know most of the bits I require in pycharm) and last time I looked at that their were two python camps that didnā€™t seem to be getting on.
I suspect the open source model might not be able to compete with commercial products in such fast developing arenas especially when commercial users might well buy up 1,500 licenses and want very specific aspects developed.

Iā€™m biased obviously I graduated from idle to eclipse and then pycharm and itā€™s my goto python environment, but itā€™s hard to learn every aspect of it. The debugger is very good and Microsoft have demonstrated that staying within one environment for development is a good model. The process of jumping between on screen terminals to start & restart particular components is an awful lot of wasted keypresses however mechanical it may become. I would be hard pressed to do much programming work without it.