I unexpectedly got RPi 3 (I bought RPi 2 on ebay and for some reason I received RPi 3), but the programs I've made so far haven't moved in various ways ^^ ;;; From November 24th Even within the range I noticed in a little over two weeks until today
--tty is now ttyS0 instead of ttyAMA0 --/ sys / class / leds / led1 / is gone and I can't turn the red LED on and off with the shell
There seems to be some places where you have to recognize whether it is RPi 3 and change the processing.
So, in any case, I can use it later also here As I reported in the supplement, [getpimodel](https://github. I made a package called com / UedaTakeyuki / getrpimodel) At that time, I made a brief report that was not very kind, so I am sorry to say that I will report the details again here.
Therefore, if there are any inefficient parts or mistakes, we would be very grateful if you could give us your frank guidance and suggestions. Thank you for your cooperation.
python
pip install getrpimodel
python
python -m getrpimodel [--s]
python
import getrpimodel
print (getrpimodel.model())
print (getrpimodel.model_strict())
This table "model" column string without parentheses (--s and model_strict () leave parentheses as they are) Specifically, B, A, B +, etc. --s and model_strict () like B (Beta)
Check according to this table
It is available on here.
Here, I use it like this
import getrpimodel
# setting
if getrpimodel.model() == "3 Model B":
serial_dev = '/dev/ttyS0'
stop_getty = 'sudo systemctl stop [email protected]'
start_getty = 'sudo systemctl start [email protected]'
else:
serial_dev = '/dev/ttyAMA0'
stop_getty = 'sudo systemctl stop [email protected]'
start_getty = 'sudo systemctl start [email protected]'```
#PyPI HereI registered with
#Acknowledgments How to register with PyPIHereI was allowed to refer to. It was very helpful and thank you.
#Impressions getrpimodel, convenient for sober