Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 KB | None | 0 0
  1. #!/bin/bash
  2. /etc/init.d/gpsd stop
  3. killall gpsd
  4. service gpsd stop
  5. rm /var/run/gpsd.sock
  6. #[ -e /dev/$1 ] && rm /dev/$1
  7. sleep 1
  8. #enable all the UBX outputs
  9. #this is DOP, but
  10. #rather than using DOP, try to use the actual error values from the receiver
  11. #echo -e '\xb5\x62\x06\x01\x03\x00\x01\x04\x01\x10\x4b' > /dev/$1
  12. #sleep 0.2
  13. #ECEF fix info, this will be converted by gpsd
  14. echo -e '\xb5\x62\x06\x01\x03\x00\x01\x06\x01\x12\x4f' > /dev/$1
  15. sleep 0.2
  16. #the LLH info, from gpsd this is used for error values?
  17. echo -e '\xb5\x62\x06\x01\x03\x00\x01\x02\x01\x0e\x47' > /dev/$1
  18. sleep 0.2
  19. #time - not necessary to get this as an extra
  20. #echo -e '\xb5\x62\x06\x01\x03\x00\x01\x20\x01\x2c\x83' > /dev/$1
  21. #sleep 0.2
  22. #these are used sats and SBAS sat info
  23. echo -e '\xb5\x62\x06\x01\x03\x00\x01\x30\x0a\x45\xac' > /dev/$1
  24. sleep 0.2
  25. echo -e '\xb5\x62\x06\x01\x03\x00\x01\x32\x0a\x47\xb0' > /dev/$1
  26. #disable i2c
  27. #gpsctl -f -t 'u-blox' -x '\x06\x00\x00\x00\x00\x00\x84\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' /dev/$1
  28. sleep 0.2
  29. echo -e '\xb5\x62\x06\x00\x14\x00\x00\x00\x00\x00\x84\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9e\x88' > /dev/$1
  30. #disable spi
  31. #gpsctl -f -t 'u-blox' -x '\x06\x00\x04\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' /dev/$1
  32. sleep 0.2
  33. echo -e '\xb5\x62\x06\x00\x14\x00\x04\x00\x00\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\x98' > /dev/$1
  34. #disable usart
  35. #gpsctl -f -t 'u-blox' -x '\x06\x00\x01\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' /dev/$1
  36. sleep 0.2
  37. echo -e '\xb5\x62\x06\x00\x14\x00\x01\x00\x00\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdb\x5c' > /dev/$1
  38. #disable all NMEA out apart from GGA (gpsd needs at least one nmea sentence or it will hang)
  39. sleep 0.2
  40. echo -e "\$PUBX,40,GSV,0,0,0,0*59\r\n" > /dev/$1
  41. sleep 0.2
  42. echo -e "\$PUBX,40,GLL,0,0,0,0*5C\r\n" > /dev/$1
  43. sleep 0.2
  44. echo -e "\$PUBX,40,RMC,0,0,0,0*47\r\n" > /dev/$1
  45. sleep 0.2
  46. echo -e "\$PUBX,40,GGA,0,0,0,0*5A\r\n" > /dev/$1 #- leave this enabled to fix gpsd
  47. sleep 0.2
  48. echo -e "\$PUBX,40,GSA,0,0,0,0*4E\r\n" > /dev/$1
  49. sleep 0.2
  50. echo -e "\$PUBX,40,VTG,0,0,0,0*5E\r\n" > /dev/$1
  51. sleep 0.2
  52. echo -e "\$PUBX,40,ZDA,0,0,0,0*44\r\n" > /dev/$1
  53. #standard config for the UBX, 10hz vehicle dynamics platform
  54. #gpsctl -f -t 'u-blox' -x '\x06\x08\x64\x00\x01\x00\x01\x00' /dev/$1
  55. sleep 0.2
  56. echo -e '\xb5\x62\x06\x08\x06\x00\x64\x00\x01\x00\x01\x00\x7a\x12' > /dev/$1
  57. #gpsctl -f -t 'u-blox' -x '\x06\x24\x04\x47\x04\x03\x00\x00\x10\x00\xff\xff\xff\xff\x05\x01\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x20\x03\x00\x00\x00\x00\x00' /dev/$1
  58. sleep 0.2
  59. echo -e '\xb5\x62\x06\x24\x23\x00\x04\x47\x04\x03\x00\x00\x10\x00\xff\xff\xff\xff\x05\x01\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x20\x03\x00\x00\x00\x00\x00\x14\x54' > /dev/$1
  60. #gpsctl -f -t 'NMEA0183' -x '$PUBX,40,GGA\x\x\x\x*' /dev/$1
  61. #configure USB to disable inputs, allow UBX and NMEA out
  62. echo -e '\xb5\x62\x06\x00\x14\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x20\x96' > /dev/$1
  63. sleep 1
  64. #/etc/init.d/gpsd start
  65. gpsd /dev/$1 -b -F /var/run/gpsd.sock
  66. #dont bother setting to binary mode with gpsctl - it doesnt do anything that hasnt already been done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement