Jump to content

Gina

Beyond the Event Horizon
  • Posts

    45,326
  • Joined

  • Last visited

  • Days Won

    120

Everything posted by Gina

  1. OK - from square one again... Wrote Ubuntu MATE to card, set parameters in config.txt as described in the AstroPi3 instructions and ran the script . What seemed like hours later the script had finished. Rebooted the system as instructed. WiFi is working and so is SSH over WiFi. Next task is to install the Astroberry 3rd party drivers. Think I might back-up the card contents first though. And having got this far successfully I think I'll call it a day.
  2. Well... WiFi isn't working and compiling the original files isn't working so maybe it's time to start again from square one!
  3. I use the ASI1600MM-Cool for DSO imaging, ASI185MC with DIY cooler for all sky camera and ASI174MM for Ha solar. Currently using Ubuntu Mate on RPi 3 for imaging.
  4. Putting the anemometer directly underneath is more tricky. Might put the wind vane on top of the mast and the anemometer on an arm a bit lower down.
  5. ASC is working well enough and other projects have gone sour so it's here again. Wirking out 3D printed parts shouldn't be too mind blowing but... Here are some initial thought on the wind vane.
  6. Looks good ?? Think I shall be getting a Rock64.
  7. Gina

    All Sky Camera Mark 7

    Compiling has failed now even with the original files so I'm leaving it. Probably get back to it later... Anyway, the ASC is working even if not exactly as I want.
  8. I'm hoping the current ROCK64 at about twice the price of an RPi should be adequate for my Ha solar imaging rig, capturing images from a ZWO ASI174MM camera at something like 100fps and for remote control of mount, focus and etalon tuning using INDI drives at the scope and KStars/Ekos indoors on my Linux Mint desktop machine. Have you got the Rock64 running the INDI drivers Julian?
  9. Copied the original file back to the micro SD card and put it back into the RPi but the compiling error still occurs Think I shall leave this and do something else...
  10. Found the board I was thinking of - ROCK64 One USB3 port and 2 USB2 and with gigabit Ethernet. No WiFi so needs the Ethernet. 4GB RAM version on Amazon but £67
  11. Update :- SSH is working with cable so it's WiFi that's failed. Trying compile and install over cable using these steps :- cd astroberry-diy/build cmake -DCMAKE_INSTALL_PREFIX=/usr .. make sudo make install sudo reboot Proceeded fine up to the make when the focuser compilation failed so that needs looking at. With no hardware connected I can revert to the original and test with that.
  12. Gina

    All Sky Camera Mark 7

    Changing the GPIO control line from GPIO12 to GPIO6 was a good move as GPIO6 has a pull-up resistor in the RPi and the logic 1 state turns off the high level cooling leaving just the low level cooling. GPIO12 and GPIO13 both have pull-down resistors so sit at logic 0 when not controlled. This is fine for the dew heater control as that is OFF with logic 0. Camera cooling control used to be the same but now the logic is inverted. Still working on a new micro SD installation on another RPi. This was going well but now I can't connect via SSH over WiFi. SSH is working with cable so it's WiFi that's failed.
  13. SSH has stopped working over WiFi. gina@Mint-Desktop ~ $ ssh gina@rpi ssh: connect to host rpi port 22: No route to host gina@Mint-Desktop ~ $
  14. The Astroberry Board driver as supplied is designed to control a PCB with 4 relays on it for switching power supplies to other equipment but can be used for anything requiring ON/OFF control for up to 4 lines. I use it to control a dew heater and on my All Sky Camera I also have a Peltier TEC cooler which is controlled by the Astroberry Board driver. For such specialised applications it's useful to change the labels on the controls displayed by Ekos and this is relatively easy in the source code. First though having saved my edited files back to the micro SD card I shall put it back in the RPi and run the compiler and installer sequence of commands.
  15. I folded the rubber around the ends on my build. Yes, good progress ??
  16. I too have the problem of wanting to do high speed capture, not particularly for planetary though that is in my thoughts for the future, but for solar Ha imaging where the same applies. I have an Ethernet feed to my observatory and 1Gbps capability so could capture what amounts to video indoors. Alternatively a USB3 computer of some sort in the observatory could be used for capture. There are several Linux based image capture applications. KStars/Ekos/INDI will certainly control domes. There is another micro-computer board like the RPi that has USB3 - forget it's name ATM.
  17. I too am virtually Linux only and use KStars/Ekos/INDI together with my own hardware for remote and auto-focussing using the Raspberry Pi 3 instead of a laptop in the observatory, right on the pier top. I'm currently adding to my tutorial blog - Setting up a Raspberry Pi for Astro Imaging and Control - Ubuntu Mate
  18. Astroberry Focuser code edited to suit the NEMA range of stepper motors and A4988 driver module. These use a different method of speed control. The speed is now set in the hardware to suit the focuser mechanics (gearing or belt reduction). Testing has shown the KStars/Ekos/INDI auto-focus routine doesn't use speed control hence the speed control has been commented out. (I've left the original code in comments in case anyone is interested in that information.) /******************************************************************************* Copyright(c) 2014 Radek Kaczorek <rkaczorek AT gmail DOT com> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. . This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. . You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *******************************************************************************/ /******************************************************************************* Modified by Gina for NEMA range of stepper motors and A4988 driver module. Remote focussing works fine without speed control and the speed control code has been commented out. Appropriate speed is set in hardware to suit focuser. *******************************************************************************/ #include <stdio.h> #include <unistd.h> #include <memory> #include <bcm2835.h> #include <string.h> #include "rpi_focus.h" // We declare an auto pointer to focusRpi. std::unique_ptr<FocusRpi> focusRpi(new FocusRpi()); // Stepper motor takes 4 miliseconds to move one step = 250 steps per second (real rate = 240,905660377) // 1) focusing from min to max takes 7 evolutions // 2) PG2528-0502U step motor makes 7 * (360deg/15degperstep)*72:1 = 1728 steps per evolution // 3) MAX_STEPS for 7 evolutions should be 12096 #define MAX_STEPS 10000 // maximum steps focuser can travel from min=0 to max #define STEP_DELAY 4 // miliseconds // indicate GPIOs used - use P1_* pin numbers not gpio numbers (!!!) //RPi B+ /* #define DIR RPI_V2_GPIO_P1_07 // GPIO4 #define STEP RPI_V2_GPIO_P1_11 // GPIO17 //#define M0 RPI_V2_GPIO_P1_15 // GPIO22 //#define M1 RPI_V2_GPIO_P1_13 // GPIO27 #define SLEEP RPI_V2_GPIO_P1_16 // GPIO23 */ //RPi 2 #define DIR RPI_BPLUS_GPIO_J8_07 // GPIO4 #define STEP RPI_BPLUS_GPIO_J8_11 // GPIO17 //#define M0 RPI_BPLUS_GPIO_J8_15 // GPIO22 //#define M1 RPI_BPLUS_GPIO_J8_13 // GPIO27 #define SLEEP RPI_BPLUS_GPIO_J8_16 // GPIO23 void ISPoll(void *p); void ISInit() { static int isInit = 0; if (isInit == 1) return; if(focusRpi.get() == 0) { isInit = 1; focusRpi.reset(new FocusRpi()); } } void ISGetProperties(const char *dev) { ISInit(); focusRpi->ISGetProperties(dev); } void ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int num) { ISInit(); focusRpi->ISNewSwitch(dev, name, states, names, num); } void ISNewText( const char *dev, const char *name, char *texts[], char *names[], int num) { ISInit(); focusRpi->ISNewText(dev, name, texts, names, num); } void ISNewNumber(const char *dev, const char *name, double values[], char *names[], int num) { ISInit(); focusRpi->ISNewNumber(dev, name, values, names, num); } void ISNewBLOB (const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n) { INDI_UNUSED(dev); INDI_UNUSED(name); INDI_UNUSED(sizes); INDI_UNUSED(blobsizes); INDI_UNUSED(blobs); INDI_UNUSED(formats); INDI_UNUSED(names); INDI_UNUSED(n); } void ISSnoopDevice (XMLEle *root) { ISInit(); focusRpi->ISSnoopDevice(root); } FocusRpi::FocusRpi() { setVersion(2,1); } FocusRpi::~FocusRpi() { } const char * FocusRpi::getDefaultName() { return (char *)"Astroberry Focuser"; } bool FocusRpi::Connect() { if (!bcm2835_init()) { IDMessage(getDeviceName(), "Problem initiating Astroberry Focuser."); return false; } // init GPIOs std::ofstream exportgpio; exportgpio.open("/sys/class/gpio/export"); exportgpio << DIR << std::endl; exportgpio << STEP << std::endl; // exportgpio << M0 << std::endl; // exportgpio << M1 << std::endl; exportgpio << SLEEP << std::endl; exportgpio.close(); // Set gpios to output mode bcm2835_gpio_fsel(DIR, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_fsel(STEP, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_fsel(SLEEP, BCM2835_GPIO_FSEL_OUTP); // bcm2835_gpio_fsel(M0, BCM2835_GPIO_FSEL_OUTP); // bcm2835_gpio_fsel(M1, BCM2835_GPIO_FSEL_OUTP); IDMessage(getDeviceName(), "Astroberry Focuser connected successfully."); return true; } bool FocusRpi::Disconnect() { // park focuser if ( FocusParkingS[0].s == ISS_ON ) { IDMessage(getDeviceName(), "Astroberry Focuser is parking..."); MoveAbsFocuser(FocusAbsPosN[0].min); } // close GPIOs std::ofstream unexportgpio; unexportgpio.open("/sys/class/gpio/unexport"); unexportgpio << DIR << std::endl; unexportgpio << STEP << std::endl; // unexportgpio << M0 << std::endl; // unexportgpio << M1 << std::endl; unexportgpio << SLEEP << std::endl; unexportgpio.close(); bcm2835_close(); IDMessage(getDeviceName(), "Astroberry Focuser disconnected successfully."); return true; } bool FocusRpi::initProperties() { INDI::Focuser::initProperties(); IUFillNumber(&FocusAbsPosN[0],"FOCUS_ABSOLUTE_POSITION","Ticks","%0.0f",0,MAX_STEPS,(int)MAX_STEPS/100,0); IUFillNumberVector(&FocusAbsPosNP,FocusAbsPosN,1,getDeviceName(),"ABS_FOCUS_POSITION","Position",MAIN_CONTROL_TAB,IP_RW,0,IPS_OK); IUFillNumber(&PresetN[0], "Preset 1", "", "%0.0f", 0, MAX_STEPS, (int)(MAX_STEPS/100), 0); IUFillNumber(&PresetN[1], "Preset 2", "", "%0.0f", 0, MAX_STEPS, (int)(MAX_STEPS/100), 0); IUFillNumber(&PresetN[2], "Preset 3", "", "%0.0f", 0, MAX_STEPS, (int)(MAX_STEPS/100), 0); IUFillNumberVector(&PresetNP, PresetN, 3, getDeviceName(), "Presets", "Presets", "Presets", IP_RW, 0, IPS_IDLE); IUFillSwitch(&PresetGotoS[0], "Preset 1", "Preset 1", ISS_OFF); IUFillSwitch(&PresetGotoS[1], "Preset 2", "Preset 2", ISS_OFF); IUFillSwitch(&PresetGotoS[2], "Preset 3", "Preset 3", ISS_OFF); IUFillSwitchVector(&PresetGotoSP, PresetGotoS, 3, getDeviceName(), "Presets Goto", "Goto", MAIN_CONTROL_TAB,IP_RW,ISR_1OFMANY,60,IPS_OK); IUFillNumber(&FocusBacklashN[0], "FOCUS_BACKLASH_VALUE", "Steps", "%0.0f", 0, (int)(MAX_STEPS/100), (int)(MAX_STEPS/1000), 0); IUFillNumberVector(&FocusBacklashNP, FocusBacklashN, 1, getDeviceName(), "FOCUS_BACKLASH", "Backlash", OPTIONS_TAB, IP_RW, 0, IPS_IDLE); IUFillSwitch(&FocusResetS[0],"FOCUS_RESET","Reset",ISS_OFF); IUFillSwitchVector(&FocusResetSP,FocusResetS,1,getDeviceName(),"FOCUS_RESET","Position Reset",OPTIONS_TAB,IP_RW,ISR_1OFMANY,60,IPS_OK); IUFillSwitch(&FocusParkingS[0],"FOCUS_PARKON","Enable",ISS_OFF); IUFillSwitch(&FocusParkingS[1],"FOCUS_PARKOFF","Disable",ISS_OFF); IUFillSwitchVector(&FocusParkingSP,FocusParkingS,2,getDeviceName(),"FOCUS_PARK","Parking Mode",OPTIONS_TAB,IP_RW,ISR_1OFMANY,60,IPS_OK); // set capabilities SetFocuserCapability(FOCUSER_CAN_ABS_MOVE | FOCUSER_CAN_REL_MOVE); return true; } void FocusRpi::ISGetProperties (const char *dev) { INDI::Focuser::ISGetProperties(dev); /* Add debug controls so we may debug driver if necessary */ addDebugControl(); return; } bool FocusRpi::updateProperties() { INDI::Focuser::updateProperties(); if (isConnected()) { deleteProperty(FocusSpeedNP.name); defineNumber(&FocusAbsPosNP); defineSwitch(&FocusMotionSP); defineNumber(&FocusBacklashNP); defineSwitch(&FocusParkingSP); defineSwitch(&FocusResetSP); } else { deleteProperty(FocusAbsPosNP.name); deleteProperty(FocusMotionSP.name); deleteProperty(FocusBacklashNP.name); deleteProperty(FocusParkingSP.name); deleteProperty(FocusResetSP.name); } return true; } bool FocusRpi::ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n) { // first we check if it's for our device if(strcmp(dev,getDeviceName())==0) { // handle focus absolute position if (!strcmp(name, FocusAbsPosNP.name)) { int newPos = (int) values[0]; if ( MoveAbsFocuser(newPos) == IPS_OK ) { IUUpdateNumber(&FocusAbsPosNP,values,names,n); FocusAbsPosNP.s=IPS_OK; IDSetNumber(&FocusAbsPosNP, NULL); } return true; } // handle focus relative position if (!strcmp(name, FocusRelPosNP.name)) { IUUpdateNumber(&FocusRelPosNP,values,names,n); //FOCUS_INWARD if ( FocusMotionS[0].s == ISS_ON ) MoveRelFocuser(FOCUS_INWARD, FocusRelPosN[0].value); //FOCUS_OUTWARD if ( FocusMotionS[1].s == ISS_ON ) MoveRelFocuser(FOCUS_OUTWARD, FocusRelPosN[0].value); FocusRelPosNP.s=IPS_OK; IDSetNumber(&FocusRelPosNP, NULL); return true; } // handle focus timer if (!strcmp(name, FocusTimerNP.name)) { IUUpdateNumber(&FocusTimerNP,values,names,n); //FOCUS_INWARD if ( FocusMotionS[0].s == ISS_ON ) MoveFocuser(FOCUS_INWARD, 0, FocusTimerN[0].value); //FOCUS_OUTWARD if ( FocusMotionS[1].s == ISS_ON ) MoveFocuser(FOCUS_OUTWARD, 0, FocusTimerN[0].value); FocusTimerNP.s=IPS_OK; IDSetNumber(&FocusTimerNP, NULL); return true; } // handle focus backlash if (!strcmp(name, FocusBacklashNP.name)) { IUUpdateNumber(&FocusBacklashNP,values,names,n); FocusBacklashNP.s=IPS_OK; IDSetNumber(&FocusBacklashNP, "Astroberry Focuser backlash set to %d", (int) FocusBacklashN[0].value); return true; } } return INDI::Focuser::ISNewNumber(dev,name,values,names,n); } bool FocusRpi::ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) { // first we check if it's for our device if (!strcmp(dev, getDeviceName())) { /* // handle focus motion in and out if (!strcmp(name, FocusMotionSP.name)) { IUUpdateSwitch(&FocusMotionSP, states, names, n); //FOCUS_INWARD if ( FocusMotionS[0].s == ISS_ON ) MoveRelFocuser(FOCUS_INWARD, FocusRelPosN[0].value); //FOCUS_OUTWARD if ( FocusMotionS[1].s == ISS_ON ) MoveRelFocuser(FOCUS_OUTWARD, FocusRelPosN[0].value); //FocusMotionS[0].s = ISS_OFF; //FocusMotionS[1].s = ISS_OFF; FocusMotionSP.s = IPS_OK; IDSetSwitch(&FocusMotionSP, NULL); return true; } */ // handle focus presets if (!strcmp(name, PresetGotoSP.name)) { IUUpdateSwitch(&PresetGotoSP, states, names, n); //Preset 1 if ( PresetGotoS[0].s == ISS_ON ) MoveAbsFocuser(PresetN[0].value); //Preset 2 if ( PresetGotoS[1].s == ISS_ON ) MoveAbsFocuser(PresetN[1].value); //Preset 2 if ( PresetGotoS[2].s == ISS_ON ) MoveAbsFocuser(PresetN[2].value); PresetGotoS[0].s = ISS_OFF; PresetGotoS[1].s = ISS_OFF; PresetGotoS[2].s = ISS_OFF; PresetGotoSP.s = IPS_OK; IDSetSwitch(&PresetGotoSP, NULL); return true; } // handle focus reset if(!strcmp(name, FocusResetSP.name)) { IUUpdateSwitch(&FocusResetSP, states, names, n); if ( FocusResetS[0].s == ISS_ON && FocusAbsPosN[0].value == FocusAbsPosN[0].min ) { FocusAbsPosN[0].value = (int)MAX_STEPS/100; IDSetNumber(&FocusAbsPosNP, NULL); MoveAbsFocuser(0); } FocusResetS[0].s = ISS_OFF; IDSetSwitch(&FocusResetSP, NULL); return true; } // handle parking mode if(!strcmp(name, FocusParkingSP.name)) { IUUpdateSwitch(&FocusParkingSP, states, names, n); IDSetSwitch(&FocusParkingSP, NULL); return true; } // handle focus abort - TODO if (!strcmp(name, AbortSP.name)) { IUUpdateSwitch(&AbortSP, states, names, n); AbortS[0].s = ISS_OFF; AbortSP.s = IPS_OK; IDSetSwitch(&AbortSP, NULL); return true; } } return INDI::Focuser::ISNewSwitch(dev,name,states,names,n); } bool FocusRpi::ISSnoopDevice (XMLEle *root) { return INDI::Focuser::ISSnoopDevice(root); } bool FocusRpi::saveConfigItems(FILE *fp) { IUSaveConfigNumber(fp, &FocusRelPosNP); IUSaveConfigNumber(fp, &PresetNP); IUSaveConfigNumber(fp, &FocusBacklashNP); IUSaveConfigSwitch(fp, &FocusParkingSP); if ( FocusParkingS[0].s == ISS_ON ) IUSaveConfigNumber(fp, &FocusAbsPosNP); return true; } IPState FocusRpi::MoveFocuser(FocusDirection dir, int speed, int duration) { int ticks = (int) ( duration / STEP_DELAY); return MoveRelFocuser( dir, ticks); } IPState FocusRpi::MoveRelFocuser(FocusDirection dir, int ticks) { int targetTicks = FocusAbsPosN[0].value + (ticks * (dir == FOCUS_INWARD ? -1 : 1)); return MoveAbsFocuser(targetTicks); } IPState FocusRpi::MoveAbsFocuser(int targetTicks) { if (targetTicks < FocusAbsPosN[0].min || targetTicks > FocusAbsPosN[0].max) { IDMessage(getDeviceName(), "Requested position is out of range."); return IPS_ALERT; } if (targetTicks == FocusAbsPosN[0].value) { // IDMessage(getDeviceName(), "Astroberry Focuser already in the requested position."); return IPS_OK; } // set focuser busy FocusAbsPosNP.s = IPS_BUSY; IDSetNumber(&FocusAbsPosNP, NULL); // motor wake up bcm2835_gpio_write(SLEEP, HIGH); // set full step size SetSpeed(1); // check last motion direction for backlash triggering char lastdir = bcm2835_gpio_lev(DIR); // set direction const char* direction; if (targetTicks > FocusAbsPosN[0].value) { // OUTWARD bcm2835_gpio_write(DIR, LOW); direction = " outward "; } else { // INWARD bcm2835_gpio_write(DIR, HIGH); direction = " inward "; } IDMessage(getDeviceName() , "Astroberry Focuser is moving %s", direction); // if direction changed do backlash adjustment if ( bcm2835_gpio_lev(DIR) != lastdir && FocusAbsPosN[0].value != 0 && FocusBacklashN[0].value != 0 ) { IDMessage(getDeviceName() , "Astroberry Focuser backlash compensation by %0.0f steps...", FocusBacklashN[0].value); for ( int i = 0; i < FocusBacklashN[0].value; i++ ) { // step on bcm2835_gpio_write(STEP, HIGH); // wait bcm2835_delay(STEP_DELAY/2); // step off bcm2835_gpio_write(STEP, LOW); // wait bcm2835_delay(STEP_DELAY/2); } } // process targetTicks int ticks = abs(targetTicks - FocusAbsPosN[0].value); for ( int i = 0; i < ticks; i++ ) { // step on bcm2835_gpio_write(STEP, HIGH); // wait bcm2835_delay(STEP_DELAY/2); // step off bcm2835_gpio_write(STEP, LOW); // wait bcm2835_delay(STEP_DELAY/2); // INWARD - count down if ( bcm2835_gpio_lev(DIR) == HIGH ) FocusAbsPosN[0].value -= 1; // OUTWARD - count up if ( bcm2835_gpio_lev(DIR) == LOW ) FocusAbsPosN[0].value += 1; IDSetNumber(&FocusAbsPosNP, NULL); } // motor sleep bcm2835_gpio_write(SLEEP, LOW); // update abspos value and status IDSetNumber(&FocusAbsPosNP, "Astroberry Focuser moved to position %0.0f", FocusAbsPosN[0].value); FocusAbsPosNP.s = IPS_OK; IDSetNumber(&FocusAbsPosNP, NULL); return IPS_OK; } bool FocusRpi::SetSpeed(int speed) { /* Stepper motor resolution settings (for PG2528-0502U) * 1) 1/1 - M0=0 M1=0 * 2) 1/2 - M0=1 M1=0 * 3) 1/4 - M0=floating M1=0 * 4) 1/8 - M0=0 M1=1 * 5) 1/16 - M0=1 M1=1 * 6) 1/32 - M0=floating M1=1 */ /********************************************************************************** switch(speed) { case 1: // 1:1 bcm2835_gpio_fsel(M0, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_fsel(M1, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_write(M0, LOW); bcm2835_gpio_write(M1, LOW); break; case 2: // 1:2 bcm2835_gpio_fsel(M0, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_fsel(M1, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_write(M0, HIGH); bcm2835_gpio_write(M1, LOW); break; case 3: // 1:4 bcm2835_gpio_fsel(M0, BCM2835_GPIO_FSEL_INPT); bcm2835_gpio_fsel(M1, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_write(M0, BCM2835_GPIO_PUD_OFF); bcm2835_gpio_write(M1, LOW); break; case 4: // 1:8 bcm2835_gpio_fsel(M0, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_fsel(M1, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_write(M0, LOW); bcm2835_gpio_write(M1, HIGH); break; case 5: // 1:16 bcm2835_gpio_fsel(M0, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_fsel(M1, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_write(M0, HIGH); bcm2835_gpio_write(M1, HIGH); break; case 6: // 1:32 bcm2835_gpio_fsel(M0, BCM2835_GPIO_FSEL_INPT); bcm2835_gpio_fsel(M1, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_write(M0, BCM2835_GPIO_PUD_OFF); bcm2835_gpio_write(M1, HIGH); break; default: // 1:1 bcm2835_gpio_fsel(M0, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_fsel(M1, BCM2835_GPIO_FSEL_OUTP); bcm2835_gpio_write(M0, LOW); bcm2835_gpio_write(M1, LOW); break; } **************************************************************************************/ return true; }
  19. To avoid having to install extra packages to support the Astroberry GPS and AltIMU I shall edit the instructions file for the C++ compilations. This is called CMakeLists.txt and is in the astroberry-diy directory. To make editing easier I take the micro SD card out of the RPi and put it in my main machine and use the GUI editor. As supplied the CMakeLists.txt is this :- cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) PROJECT(astroberry CXX C) include(ExternalProject) set (VERSION_MAJOR 1) set (VERSION_MINOR 0) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/") set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin") set(CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}") find_package(INDI REQUIRED) #configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h ) include_directories( ${CMAKE_CURRENT_BINARY_DIR}) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}) include_directories( ${INDI_INCLUDE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/libs/bcm2835-1.52/src) add_library(bcm2835 STATIC IMPORTED) set_property(TARGET bcm2835 PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libs/bcm2835-1.52/src/libbcm2835.a) add_dependencies(bcm2835 libbcm2835) ################ libbcm2835 ################ ExternalProject_Add(libbcm2835 URL "http://www.airspayce.com/mikem/bcm2835/bcm2835-1.52.tar.gz" SOURCE_DIR ${CMAKE_SOURCE_DIR}/libs/bcm2835-1.52 PREFIX ${CMAKE_CURRENT_BINARY_DIR}/bcm2835-1.52 CONFIGURE_COMMAND ./configure BUILD_COMMAND ${MAKE} INSTALL_COMMAND "" BUILD_IN_SOURCE 1 ) ################ Astroberry Board ################ set(indi_rpibrd_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/rpi_brd.cpp ) add_executable(indi_rpibrd ${indi_rpibrd_SRCS}) target_link_libraries(indi_rpibrd indidriver bcm2835) install(TARGETS indi_rpibrd RUNTIME DESTINATION bin ) install(FILES indi_rpibrd.xml DESTINATION ${INDI_DATA_DIR}) ################ Astroberry AltIMU ################ set(indi_rpialtimu_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/rpi_altimu.cpp ) add_executable(indi_rpialtimu ${indi_rpialtimu_SRCS}) target_link_libraries(indi_rpialtimu indidriver RTIMULib) install(TARGETS indi_rpialtimu RUNTIME DESTINATION bin ) install(FILES indi_rpialtimu.xml DESTINATION ${INDI_DATA_DIR}) ################ Astroberry GPS ################ set(indi_rpigps_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/rpi_gps.cpp ) add_executable(indi_rpigps ${indi_rpigps_SRCS}) target_link_libraries(indi_rpigps indidriver gps nova) install(TARGETS indi_rpigps RUNTIME DESTINATION bin ) install(FILES indi_rpigps.xml DESTINATION ${INDI_DATA_DIR}) ################ Astroberry Focuser ################ set(indi_rpifocus_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/rpi_focus.cpp ) add_executable(indi_rpifocus ${indi_rpifocus_SRCS}) target_link_libraries(indi_rpifocus indidriver bcm2835) install(TARGETS indi_rpifocus RUNTIME DESTINATION bin ) install(FILES indi_rpifocus.xml DESTINATION ${INDI_DATA_DIR}) We need to remove the sections for the GPS and AltIMU :- cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) PROJECT(astroberry CXX C) include(ExternalProject) set (VERSION_MAJOR 1) set (VERSION_MINOR 0) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/") set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin") set(CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}") find_package(INDI REQUIRED) #configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h ) include_directories( ${CMAKE_CURRENT_BINARY_DIR}) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}) include_directories( ${INDI_INCLUDE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/libs/bcm2835-1.52/src) add_library(bcm2835 STATIC IMPORTED) set_property(TARGET bcm2835 PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libs/bcm2835-1.52/src/libbcm2835.a) add_dependencies(bcm2835 libbcm2835) ################ libbcm2835 ################ ExternalProject_Add(libbcm2835 URL "http://www.airspayce.com/mikem/bcm2835/bcm2835-1.52.tar.gz" SOURCE_DIR ${CMAKE_SOURCE_DIR}/libs/bcm2835-1.52 PREFIX ${CMAKE_CURRENT_BINARY_DIR}/bcm2835-1.52 CONFIGURE_COMMAND ./configure BUILD_COMMAND ${MAKE} INSTALL_COMMAND "" BUILD_IN_SOURCE 1 ) ################ Astroberry Board ################ set(indi_rpibrd_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/rpi_brd.cpp ) add_executable(indi_rpibrd ${indi_rpibrd_SRCS}) target_link_libraries(indi_rpibrd indidriver bcm2835) install(TARGETS indi_rpibrd RUNTIME DESTINATION bin ) install(FILES indi_rpibrd.xml DESTINATION ${INDI_DATA_DIR}) ################ Astroberry AltIMU ################ ################ Astroberry GPS ################ ############### Astroberry Focuser ################ set(indi_rpifocus_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/rpi_focus.cpp ) add_executable(indi_rpifocus ${indi_rpifocus_SRCS}) target_link_libraries(indi_rpifocus indidriver bcm2835) install(TARGETS indi_rpifocus RUNTIME DESTINATION bin ) install(FILES indi_rpifocus.xml DESTINATION ${INDI_DATA_DIR}) After editing the file is saved back to the micro SD card (may be obvious but can be forgotten). At this point the source code will compile but I am using a different stepper motor and driver module from the one for which the Astroberry Focuser code was written. I will cover this in the next post.
  20. Before the C++ source code can be compiled we need to install cmake. sudo apt install cmake
  21. I have installed Ubuntu MATE and followed the instructions to run the AstroPi3 script. At this point I believe the INDI drivers and some other astro software has been installed. SSH has been enabled so that now the RPi can be accessed remotely from Terminal. eg. ssh gina@rpi where gina is my user name and rpi is the computer name as set up during the Ubuntu MATE installation. Installing 3rd Party Drivers Next step is to attempt installing the Astroberry drivers. The package contains four drivers of which I shall use two, with the source code modified to suit my needs. The drivers I'm using are for focussing and a modified version of the Astroberry Board to provide ON/OFF controls for such things as dew heaters.
  22. Gina

    All Sky Camera Mark 7

    Exposure 1ms. Camera temperature 1.6°C.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.