Hello.
I try to build my own diy version of fabscan but i have connection problems.
I can use an arduino pro micro (atmega32u4) and my diy hat (based an fabscan uno hat schematics) with one stepper and two lasers only and pi noir cam with adjustable focus connected to pi via usb.
With arduino pro micro i have compile/upload with IDE your firmware (from: https://github.com/mariolukas/FabScanPi-Firmware) and the changes i have made as follow:
a. boards.h:
#ifndef BOARDS_H
#define BOARDS_H
//#define BOARD_UNKNOWN -1
//#define BOARD_FABSCANPI 1
//#define BOARD_CYCLOP 2
//#define BOARD_SANGOINOLOLU 3
//#define BOARD_CNCSHIELD 4
#define BOARD_PIPITS 5
#define MB(board) (MOTHERBOARD==BOARD_##board)
#endif
b. configuration.h
// FabScan - http://hci.rwth-aachen.de/fabscan
//
// Created by Mario Lukas on 04/08/14.
// Copyright 2014 Media Computing Group, RWTH Aachen University. All rights reserved.
//
//#define VERBOSE 0
// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4)
//#define MACHINE_UUID "4dabfe2e-c094-4f04-8bd4-669f24460735"
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
/*
- The following define selects which electronics board you have.
- Please choose the name from boards.h that matches your setup.
- Some possible Values are:
- BOARD_FABSCANPI - FabScanPi Hat for Raspberry Pi
- BOARD_CYCLOP - Cyclop Scanner ZUM Scan Board
- BOARD_SANGUINOLOLU - Sanguinololu 3D Printer Board v 1.3
- BOARD_CNCSHIELD - Arduino Uno with CNC shield V3.0 or newer (see grbl project for pinout)
*/
#ifndef MOTHERBOARD
#define MOTHERBOARD BOARD_PIPITS
#endif
#ifndef BAUDRATE
#define BAUDRATE 115200
#endif
#define TURN_BLOCKING 1
#define TURN_NON_BLOCKING 0
#define NUMPIXELS 16
#define MAX_FEEDRATE (2000)
#define MIN_FEEDRATE (1000)
#define MAX_BUF 64
#endif
c.pins.h
#ifndef PINS_H
#define PINS_H
#if MB(FABSCANPI)
#include "pins_FABSCANPI.h"
#elif MB(CYCLOP)
#include "pins_CYCLOP.h"
#elif MB(SANGOINOLOLU)
#include "pins_SANGOINOLOLU.h"
#elif MB(CNCSHIELD)
#include "pins_CNCSHIELD.h"
#elif MB(PIPITS)
#include "pins_PIPITS.h"
#endif
#endif
d.pins_PIPITS.h
#ifndef PINS_PIPITS_H
#define PINS_PIPITS_H
#ifndef BOARD_NAME
#define BOARD_NAME "PIPITS"
#endif
/*
- Laser
/
#define RIGHT_LASER_PIN 8
#define LEFT_LASER_PIN 9
#define MICROSTEP A10
/
- Turntable Stepper
/
#define ENABLE_PIN_0 21
#define STEP_PIN_0 20
#define DIR_PIN_0 19
/*
- WS2812 LED
/
#define LIGHT_PIN A6
/*
- Optional Laser Stepper
/
#define ENABLE_PIN_1 5
#define STEP_PIN_1 6
#define DIR_PIN_1 7
/*
- Optional Laser Servos
/
#define RIGHT_SERVO_PIN 14
#define LEFT_SERVO_PIN 16
/*
- STEPPER DEFINES FOR SELECTION
*/
#define LASER_STEPPER 2 //0xb
#define TURNTABLE_STEPPER 3 //0xa
#endif
So i have try with both latest version of prebuild image (0.94server and 0.93server)
and when i use the commands "sudo echo "M19" > /dev/ttyACM0" or "sudo echo "M19" > /dev/serial/by-id/usb-Arduino_LLC_Arduino_Micro-if00" at terminal (i can use all of the commands M and G) the system works as expected (laser on/off, motor disable/enable, motor running). (PiOS read device as /dev/ttyACM0 and not as /dev/ttyUSB0).
--------------P R O B L E M-------------------------------------------------
BUT the server not running with the following problems from log file (changes made only to etc folder at file default.config.json) :
- if i use:
"serial": {
"plattform_type": "pipits",
"baudrate": 115200,
"autoflash": "False",
"port": "/dev/serial/by-id/usb-Arduino_LLC_Arduino_Micro-if00",
"flash_baudrate": 115200
2021-03-04 09:38:20,098 [521:1996384976] INFO - fabscan.server.FSScanServer: FabScanPi-Server 0.9.3
2021-03-04 09:38:20,106 [521:1996384976] DEBUG - fabscan.scanner.interfaces: Scanner Type is: laserscanner
2021-03-04 09:38:21,948 [521:1996384976] DEBUG - fabscan.scanner.laserscanner.driver.FSSerial: Port in Config found
2021-03-04 09:38:21,953 [521:1996384976] CRITICAL - fabscan: Fatal error: max() arg is an empty sequence
(which seems that connection made but sth is missing)
- if i use:
"serial": {
"plattform_type": "pipits",
"baudrate": 115200,
"autoflash": "False",
"port": "/dev/ttyACM0",
"flash_baudrate": 115200
2021-03-04 09:38:20,098 [521:1996384976] INFO - fabscan.server.FSScanServer: FabScanPi-Server 0.9.3
2021-03-04 09:38:20,106 [521:1996384976] DEBUG - fabscan.scanner.interfaces: Scanner Type is: laserscanner
2021-03-04 09:38:21,948 [521:1996384976] DEBUG - fabscan.scanner.laserscanner.driver.FSSerial: Port in Config found
2021-03-04 09:38:21,953 [521:1996384976] CRITICAL - fabscan: Fatal error: max() arg is an empty sequence
(which seems that connection made but sth is missing)
- if i use:
"serial": {
"plattform_type": "fabscanpi or ciclop",
"baudrate": 115200,
"autoflash": "False",
"port": "/dev/ttyACM0",
"flash_baudrate": 115200
2021-03-04 09:45:44,474 [685:1995705040] INFO - fabscan.server.FSScanServer: FabScanPi-Server 0.9.3
2021-03-04 09:45:44,478 [685:1995705040] DEBUG - fabscan.scanner.interfaces: Scanner Type is: laserscanner
2021-03-04 09:45:45,450 [685:1995705040] DEBUG - fabscan.scanner.laserscanner.driver.FSSerial: Port in Config found
2021-03-04 09:45:45,452 [685:1995705040] DEBUG - fabscan.scanner.laserscanner.driver.FSSerial: Latest available firmware version is: v.20200624
2021-03-04 09:45:47,016 [685:1995705040] ERROR - fabscan.scanner.laserscanner.driver.FSSerial: Communication error on port /dev/ttyACM0 try other flashing baudrate than 115200. Maybe corrupted bootloader.
2021-03-04 09:45:47,017 [685:1995705040] ERROR - fabscan.scanner.laserscanner.driver.FSSerial: Fatal FabScanPi HAT or compatible connection error: 'NoneType' object has no attribute 'isOpen'
2021-03-04 09:45:47,017 [685:1995705040] INFO - fabscan.server.FSScanServer: FabScan Server Exit. Bye!
(which seems that connection made but a lot of things are wrong, so i beleive this is the wrong approach and i have to used the setup no.1 or no.2 (maybe no.1 because then there is no matter in which port the arduino will be connected) where the server just stuck and not exit).
--------------Q U E S T I O N-------------------------------------------------
What i miss in my configuration and the server not running???
What else i have to add/change for fabscan to read my hardware???
If i success i can give you all of the setup for arduino pro micro to update the setup/config files.
I 'm waiting for your response.
Thnks.