Sunday, July 15, 2018

MSP430f169 LCD development environment

Until now I always developed code for the  Olimex board MSP430F169 LCD using an open source compiler (GNU) and using a parallel port->JTAG adapter to program the board and do some debug.
That requires a computer with parallel port.
The goal of this article is to see if is possible to use an USB->JTAG adapter or using the Spy-by-wire connection.

Saturday, July 14, 2018

Developer tips - Visual Studio - Apple iOS erase certificates

Disclaimer !
This article is based on tests/research/finding at April 2018. Things can change.

Sometime is better to clean up the mess of certificates used by Xamarin for Apple iOS development.
Here what to do based on my experience.

Normally the certificates are generated/maintained on the Apple Developer website.
Every time a new certificate or provisioning profile is created or a current certificate (or provisioning profile) is modified, is necessary to download them on the development machine.
There, Xcode will provide to load them in a specific location and update the local keys database.

The problem is that after some time, EVERY certificate/provisioning profile generated, will be stored on the local machine. It can become very messy remember what is what.

Erase current certificates

The certificates used by Xamarin are stored in this directory : ~/Library/MobileDevice/Provisioning Profiles/

Of course this place is managed by Xcode, so ALL the certificates used by Xcode and Xamarin are here, meaning that if you erase them ALL the development on both environment will be affected !
Better do a backup just in case.  Since the names of the file in that location are ..cryptic, is not easy to know what is what.

The ideal condition when to erase everything is when you can re-obtain EVERY certificate you need to use for development from the Apple Developer website.
So let assume we can safely remove all certificates.
If you are not sure to be able to retrieve all of them, STOP NOW !


The certificates are associated with private keys stored in the local machine (app Keychain access).
It should NOT be necessary to remove also the private keys and as usual, it can be dangerous messing up with that.
However, usually is possible  to identify the involved keys.
Under the login (in the Keychain Access app) the related keys are generally marked as iPhone Developer : xxxxxxxxxx or iPhone Distribution : xxxxxxxxxxxx
Removing them will remove the private key associated to the certificate.

Restore the certificates/provisioning profile

Simply go on the Apple Developer website, go on the certificates/provisioning profile you want to have and download them on your machine.
Be sure they are marked as Active !

Then simply "open" them with the default app that should be Xcode.
That it.
Xcode will populate the directory ~/Library/MobileDevice/Provisioning Profiles/.

VPN - troubleshooting

Here some tips to solve problems related to the Raspberry Pi VPN.

VPN connect but no internet

VPN is working, can connect with client, but no data are passing thru

 Check some basic settings first
  • /etc/sysctl.confEdit the file and verify that the line net.ipv4.ip_forward=1 is uncommented and thus present.
    Force activation anyway after editing with : sudo sysctl -p
  • /etc/
    • Edit the file and verify that contains the line below :
      iptables -t nat -A POSTROUTING -s -o eth0 -j MASQUERADE
    • Force correct ownership and permission on the file
      sudo chmod 700 /etc/
      sudo chown root /etc/
    • Force the call to the script in bashrc to be sure is called at boot.
      Edit : ~/.bashrc and add the call to the with sudo
  • Run raspi-config and select the boot option to wait for network at the bootstrap time
  • If still the VPN is not working after a bootstrap, try manually restart the openvpn.
    sudo service openvpn restart