0

I'll preface this buy saying I am very new to working with Arduino boards or hardware in general. I am attempting to follow a tutorial on instructables

http://www.instructables.com/id/PCBot/step4/Printer-test/

I have my board and printer wired up properly and I have git cloned the python thermal printer. My issue begins at this paragraph:

Open the UART0 serial port by default the GPIO's of the edison are disables.

You can enable them by programming the edison via the Arduino IDE or by using the MRAA library available for several programming languages.

To open enable the UART0 port, TX RX on the edison breakout board, open a Python shell in the thermal and write:

import mraa

x=mraa.Uart(0)

I opened a python shell and entered the import mraa lines and tried to run the printertest.py

I receive an error that says no module named serial. I am not sure where the issue is. I thought the Edison already had python serial installed. I did try to install it with opkg install python-serial but it didn't work. If my issue is with enabling the Uart0 port I am not sure how to go about doing it. I have the Arduino IDE installed but I have no idea how to go about enabling it via the Arduino IDE. The instructions are a bit vague in that paragraph.

*Update I have successfully installed pip and got pyserial installed. Now when I try to run the printertest.py I get an error OSError: [Errno 2] No such file or directory: '/dev/ttyAMA0' which I think is potentially caused by me not succesfully opening Uart0 port but I am not sure how to. I tried adding the import in a shell as well as adding it directly to the code via nano

Jeff S
  • 101
  • 4
  • did you try with pip? – Igor Stoppa Oct 25 '15 at 20:53
  • I tried to install pip but I got an error. – Jeff S Oct 25 '15 at 20:56
  • I suggest you paste the opkg error. Just as you describe the problem right now, it's hard to say much, without logs. Same as with pip: show how it fails. – Igor Stoppa Oct 25 '15 at 20:57
  • I just found out I need unofficial repos to install pip so i'll try that next – Jeff S Oct 25 '15 at 21:03
  • I followed this blog to install pip on the edison http://blog.salvius.org/2015/05/installing-pip-on-intel-edison.html ; however, when I try to install pyserial with pip it says -sh: pip: command not found – Jeff S Oct 25 '15 at 21:21
  • @IgorStoppa here is the error from just trying to use opkg `root@edison:~# opkg install python-serial Unknown package 'python-serial'. Collected errors: * opkg_conf_parse_file: Duplicate src declaration (all http://repo.opkg.net/edison/repo/all). Skipping. * opkg_install_cmd: Cannot install package python-serial.` – Jeff S Oct 25 '15 at 22:17
  • how about the full list of repositories? did you check if it's configured as in your example? – Igor Stoppa Oct 25 '15 at 22:26
  • Another - painful, for sure - way to install it, is to modify the list of components and rebuild the image. But I'd keep it as really last resort, as it is likely to take easily a couple of hours straight, if not more. – Igor Stoppa Oct 25 '15 at 22:28
  • @IgorStoppa I might have to try reflashing the newest image. I don't notice any errors adding official or unofficial repos. The pip installation appears to have no errors. – Jeff S Oct 25 '15 at 23:05

1 Answers1

0

I have solved the issues and successfully connected this printer with the Compute Module. I solved the issue by changing the target of /dev/ttyAMA0 to /dev/ttyMFD1 as shown by http://iotdk.intel.com/docs/master/mraa/edison.html . This was the final step after I had installed pyserial.

Jeff S
  • 101
  • 4