Advertisement
Guest User

Untitled

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